Package com.oracle.bmc.http.client.pki
Class Pem.Decoder
- java.lang.Object
-
- com.oracle.bmc.http.client.pki.Pem.Decoder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificatedecodeCertificate(String contents)Decode an X509 certificateCertificatedecodeCertificate(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 chainPrivateKeydecodePrivateKey(byte[] contents)Decode a private key.PrivateKeydecodePrivateKey(ReadableByteChannel bytes)Decode a private key.PublicKeydecodePublicKey(String contents)Decode a public keyPublicKeydecodePublicKey(ReadableByteChannel contents)Decode a public keyPem.Decoderwith(Pem.Passphrase passphrase)Produce a decoder configured to use the specified passphrase for encrypted private keys
-
-
-
Method Detail
-
with
public Pem.Decoder with(Pem.Passphrase passphrase)
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
public Certificate decodeCertificate(String contents)
Decode an X509 certificate- Parameters:
contents- The PEM encoded form of the X509 certificate- Returns:
- Certificate instance
-
decodeCertificate
public Certificate decodeCertificate(ReadableByteChannel contents)
Decode an X509 certificate- Parameters:
contents- The PEM encoded form of the X509 certificate- Returns:
- Certificate instance
-
decodeCertificateChain
public Collection<? extends Certificate> decodeCertificateChain(String contents)
Decode an X509 certificate chain- Parameters:
contents- The PEM encoded certificate chain- Returns:
- Collection of Certificate instances
-
decodeCertificateChain
public Collection<? extends Certificate> decodeCertificateChain(ReadableByteChannel contents)
Decode an X509 certificate chain- Parameters:
contents- The PEM encoded certificate chain- Returns:
- Collection of Certificate instances
-
decodePrivateKey
public PrivateKey decodePrivateKey(ReadableByteChannel bytes) throws IOException
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
public PrivateKey decodePrivateKey(byte[] contents)
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
public PublicKey decodePublicKey(String contents)
Decode a public key- Parameters:
contents- The PEM encoded public key- Returns:
- PublicKey instance
-
decodePublicKey
public PublicKey decodePublicKey(ReadableByteChannel contents)
Decode a public key- Parameters:
contents- The PEM encoded public key- Returns:
- PublicKey instance
-
-