RFR: 8298420: PEM API: Implementation (Preview) [v18]
Anthony Scarpino
ascarpino at openjdk.org
Wed May 14 08:25:53 UTC 2025
On Tue, 13 May 2025 22:28:48 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> src/java.base/share/classes/java/security/PEMDecoder.java line 464:
>>
>>> 462: *
>>> 463: * <p>If {@code provider} is {@code null}, a new instance is returned with
>>> 464: * the default provider configuration.
>>
>> IMHO, I think this is working around a bug in the calling code and an NPE should be thrown instead.
>
> Yes, it's not worth calling `withFactory(null)` to remove preferred provider configuration. We already have `PEMDecoder.of()`.
I like null, but I guess I see your point.
>> src/java.base/share/classes/java/security/PEMEncoder.java line 62:
>>
>>> 60: * configured to encrypt the key with that password. Alternatively, a
>>> 61: * private key encrypted as an {@code EncryptedKeyInfo} object can be encoded
>>> 62: * directly to PEM by passing it to the encode method
>>
>> s/encode method/`encode` or `encodeToString` methods./
>
> Add a period at the end. Do we need to say `of a normal PEMEncoder` since encryption is done elsewhere.
ok
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2087786189
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2087800378
More information about the security-dev
mailing list