# JEP targeted to JDK 28: 542: PEM Encodings of Cryptographic Objects

DevFeed: [JEP targeted to JDK 28: 542: PEM Encodings of Cryptographic Objects](<https://devfeed.tech/articles/jep-targeted-to-jdk-28-542-pem-encodings-of-cryptographic-objects-65311.md>)

Original publisher: [Read original article](<https://inside.java/2026/10/06/jep542-target-jdk28/>)

Author: Anthony Scarpino

Published: 2026-10-06T00:00:00Z

Content type: article

Language: en

Sources: [Inside Java](<https://devfeed.tech/sources/inside-java.md>)

Topics: [openjdk](<https://devfeed.tech/topics/openjdk.md>), [format](<https://devfeed.tech/topics/format.md>), [Encryption](<https://devfeed.tech/topics/encryption.md>), [public key](<https://devfeed.tech/topics/public-key.md>), [test](<https://devfeed.tech/topics/test.md>), [openssl](<https://devfeed.tech/topics/openssl.md>), [digital signature](<https://devfeed.tech/topics/digital-signature.md>)

Tags: [2022](<https://devfeed.tech/tags/2022.md>), [abstract](<https://devfeed.tech/tags/abstract.md>), [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [added](<https://devfeed.tech/tags/added.md>), [advanced](<https://devfeed.tech/tags/advanced.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [all](<https://devfeed.tech/tags/all.md>), [also](<https://devfeed.tech/tags/also.md>), [alternatives](<https://devfeed.tech/tags/alternatives.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [application](<https://devfeed.tech/tags/application.md>), [applications](<https://devfeed.tech/tags/applications.md>), [approach](<https://devfeed.tech/tags/approach.md>), [argument](<https://devfeed.tech/tags/argument.md>), [array](<https://devfeed.tech/tags/array.md>), [cryptographic](<https://devfeed.tech/tags/cryptographic.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-28](<https://devfeed.tech/tags/jdk-28.md>), [jep](<https://devfeed.tech/tags/jep.md>), [security](<https://devfeed.tech/tags/security.md>)

## AI overview

JEP 542 proposes finalizing a Java API for converting cryptographic keys, certificates, and certificate revocation lists between Java objects and PEM text. Immutable, reusable `PEMEncoder` and `PEMDecoder` instances handle conversion; optional password configuration supports private-key encryption and decryption, while provider selection lets decoding use factories from a specified cryptographic provider. The `PEM` class preserves PEM data for types without a Java API, and `EncryptedPrivateKeyInfo` adds methods for password or key-based encryption and decryption, including advanced parameter and provider options. Supported standard encodings include PKCS#8 and X.509. The proposal specifies ISO-8859-1 for byte-array output and input-stream decoding; decoder input before the PEM header is ignored unless decoded as `PEM`. Malformed input raises `IllegalArgumentException`, and decryption failures raise `CryptoException`. The JEP says the API had three preview releases and is proposed for finalization without further change.

## Source excerpt

The following JEP is targeted to JDK 28: 542: PEM Encodings of Cryptographic Objects