RFR: 8298420: PEM API: Implementation (Preview) [v19]
Weijun Wang
weijun at openjdk.org
Tue May 13 22:05:11 UTC 2025
On Tue, 13 May 2025 21:45:32 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:
>> Hi all,
>>
>> I need a code review of the PEM API. Privacy-Enhanced Mail (PEM) is a format for encoding and decoding cryptographic keys and certificates. It will be integrated into JDK24 as a Preview Feature. Preview features does not permanently define the API and it is subject to change in future releases until it is finalized.
>>
>> Details about this change can be seen at [PEM API JEP](https://bugs.openjdk.org/browse/JDK-8300911).
>>
>> Thanks
>>
>> Tony
>
> Anthony Scarpino has updated the pull request incrementally with one additional commit since the last revision:
>
> comments
src/java.base/share/classes/java/security/PEMRecord.java line 50:
> 48: * <p> During the instantiation of this record, there is no validation
> 49: * for the {@code type} or {@code pem}. {@code leadingData} is not
> 50: * defensively copied.
Not only instantiation, but the data is also not defensively copied when someone calls `leadingData`. Do we need to mention this as well?
src/java.base/share/classes/java/security/PEMRecord.java line 76:
> 74: * before the PEM header. This value maybe {@code null}.
> 75: * @throws IllegalArgumentException if the {@code type} is incorrectly
> 76: * formatted.
Is there a place defining what is a correctly formatted `type`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2087696151
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2087692238
More information about the security-dev
mailing list