RFR: 8298420: PEM API: Implementation (Preview) [v14]

Sean Mullan mullan at openjdk.org
Thu May 8 13:53:13 UTC 2025


On Sat, 26 Apr 2025 08:39:50 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:

>> src/java.base/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java line 83:
>> 
>>> 81:      * Constructs an {@code EncryptedPrivateKeyInfo} from a given Encrypted
>>> 82:      * PKCS#8 ASN.1 encoding.
>>> 83:      * @param encoded the ASN.1 encoding which is cloned and then parsed.
>> 
>> Somehow I prefer the original "The contents of the array...". We've used this style in a lot of places.
>
> I didn't change the rest of them because I didn't want to make too many unnecessary edits.  I understand you like it, but it is not a concise description. 
> 
> The one word "cloned" is a lot simpler and means the same as:
> "The contents of {@code encryptedData} are copied to protect against subsequent modification when constructing this object."

The words "to protect against subsequent modification" are important and if I recall was something we added a long time ago to many of our APIs. I would restore the original text. Also, the other constructor is still using those words.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2079745280


More information about the security-dev mailing list