RFR: 8360564: Implement JEP 524: PEM Encodings of Cryptographic Objects (Second Preview) [v4]
Weijun Wang
weijun at openjdk.org
Wed Oct 1 21:20:29 UTC 2025
On Wed, 1 Oct 2025 18:46:43 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> src/java.base/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java line 368:
>>
>>> 366: */
>>> 367: @PreviewFeature(feature = PreviewFeature.Feature.PEM_API)
>>> 368: public static EncryptedPrivateKeyInfo encryptKey(DEREncodable de,
>>
>> Shall we name it `encryptKey` or simply `encrypt`? I'm asking because it can be something other than a key. The decrypt side has `getKey`, `getKeySpec`, and `getKayPair`. Since we have only one on the encrypt side, it needn't use the noun of one of them.
>
> I cannot comment on the `@param provider` line. Shall we change "the Provider will be used" to "the Provider used"? This is consistent with `getKeyPair`.
I also cannot comment on the `@throws NullPointerException` line. How about changing ". If" there to ", or if"? This appears in other methods as well.
Also, for other places when an NPE is thrown, sometimes you use "when the key or password is null", sometimes it's "if the key or password are null". Please use the same wording.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27147#discussion_r2395535170
More information about the security-dev
mailing list