RFR: 8358099: PEM spec updates

Sean Mullan mullan at openjdk.org
Tue Jun 3 16:31:56 UTC 2025


On Tue, 3 Jun 2025 16:09:32 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:

> Hi, I need a review of some PEM updates.  `PEMRecord.pem` is renamed to `content` to better describe that it is the base64 content and not including the header and footer. Additionally, `PEMRecord.getEncoded()` is removed and some javadoc clarifications for PEMEncoder and PEMDecoder.  Thanks.

src/java.base/share/classes/java/security/PEMDecoder.java line 93:

> 91:  * public key will be returned in that format.  Any type of PEM data can be
> 92:  * decoded into a {@code PEMRecord} by specifying {@code PEMRecord.class}.
> 93:  * If the class parameter doesn't match the PEM content, an

s/an/a/

src/java.base/share/classes/java/security/PEMDecoder.java line 127:

> 125:  * @implNote An implementation may support other PEM types and
> 126:  * {@code DEREncodable} objects. This implementation additionally supports
> 127:  * PEM types:  {@code X509 CERTIFICATE}, {@code X.509 CERTIFICATE}, {@code CRL},

Suggest to insert "the following" before "PEM types"

src/java.base/share/classes/java/security/PEMEncoder.java line 291:

> 289: 
> 290:         // If `keySpec` is non-null, then `key` hasn't been established.
> 291:         // Setting a `key` prevents repeated key generations operations.

s/generations/generation/

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25620#discussion_r2124365392
PR Review Comment: https://git.openjdk.org/jdk/pull/25620#discussion_r2124371518
PR Review Comment: https://git.openjdk.org/jdk/pull/25620#discussion_r2124374177


More information about the security-dev mailing list