Class Pem
java.lang.Object
com.codename1.backend.security.pki.Pem
PEM, the base64 text form of DER that openssl reads and writes: one or
more blocks between -----BEGIN <label>----- and -----END <label>-----.
List<Pem.Block> blocks = Pem.decode(fullChainPem);
String pem = Pem.encode(Pem.CERTIFICATE, certificate.getEncoded());
Text outside the blocks, such as the Bag Attributes lines openssl pkcs12 prints, is ignored. A block with RFC 1421 headers (an encrypted
traditional key) is refused, since its content is not plain DER.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne PEM block: its label and its DER content. -
Field Summary
Fields -
Method Summary
-
Field Details
-
CERTIFICATE
-
CERTIFICATE_REQUEST
The label of a PKCS#10 certification request.- See Also:
-
PRIVATE_KEY
-
PUBLIC_KEY
-
-
Method Details
-
decode
Every block inpem, in order.- Throws:
IOException- when there is no block, a block is not closed, or a block's content is not base64
-
decode
The DER of every block labelledlabel, in order; empty when there is none.- Throws:
IOException
-
encode
-