Package oracle.nosql.driver.iam.pki
Class Pem.Decoder
java.lang.Object
oracle.nosql.driver.iam.pki.Pem.Decoder
- Enclosing class:
- Pem
Decodes PEM encoded text streams into the desired format
-
Method Summary
Modifier and TypeMethodDescriptiondecodeCertificate
(String contents) Decode an X509 certificatedecodeCertificate
(ReadableByteChannel contents) Decode an X509 certificateCollection<? extends Certificate>
decodeCertificateChain
(String contents) Decode an X509 certificate chainCollection<? extends Certificate>
decodeCertificateChain
(ReadableByteChannel contents) Decode an X509 certificate chaindecodePrivateKey
(byte[] contents) Decode a private key.Decode a private key.decodePublicKey
(String contents) Decode a public keydecodePublicKey
(ReadableByteChannel contents) Decode a public keywith
(Pem.Passphrase passphrase) Produce a decoder configured to use the specified passphrase for encrypted private keys
-
Method Details
-
with
Produce a decoder configured to use the specified passphrase for encrypted private keys- Parameters:
passphrase
- The passphrase or null if no encrypted private keys will be decoded- Returns:
- Decoder instance
-
decodeCertificate
Decode an X509 certificate- Parameters:
contents
- The PEM encoded form of the X509 certificate- Returns:
- Certificate instance
-
decodeCertificate
Decode an X509 certificate- Parameters:
contents
- The PEM encoded form of the X509 certificate- Returns:
- Certificate instance
-
decodeCertificateChain
Decode an X509 certificate chain- Parameters:
contents
- The PEM encoded certificate chain- Returns:
- Collection of Certificate instances
-
decodeCertificateChain
Decode an X509 certificate chain- Parameters:
contents
- The PEM encoded certificate chain- Returns:
- Collection of Certificate instances
-
decodePrivateKey
Decode a private key. The private key is sensitive data, the caller is responsible for ensuring the input stream is closed (and any backing storage is erased)- Parameters:
bytes
- The PEM encoded private key as UTF-8 encoded byte stream- Returns:
- PrivateKey instance
- Throws:
IOException
-
decodePrivateKey
Decode a private key. The private key is sensitive data and must be provided as a byte array. The caller is responsible for erasing the byte array after use.- Parameters:
contents
- The PEM encoded private key as UTF-8 encoded bytes- Returns:
- PrivateKey instance
-
decodePublicKey
Decode a public key- Parameters:
contents
- The PEM encoded public key- Returns:
- PublicKey instance
-
decodePublicKey
Decode a public key- Parameters:
contents
- The PEM encoded public key- Returns:
- PublicKey instance
-