On Mon, 12 Jun 2023 18:49:59 GMT, Ben Perez <d...@openjdk.org> wrote:

> Changed `getEncoded` for both EC and RSA to return a copy of the internal key 
> array to avoid mutability issues.

src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java line 
99:

> 97:             byte[] safeEncoding = new byte[encoding.length];
> 98:             System.arraycopy(encoding, 0, safeEncoding, 0, 
> encoding.length);
> 99:             return safeEncoding;

You can replace these lines (and below) with `return encoding.clone();` which 
is more compact and the same AFAICT.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14425#discussion_r1230130701

Reply via email to