public class PEMCredential extends AbstractDelegatingX509Credential
delegate
Constructor and Description |
---|
PEMCredential(java.io.InputStream keystoreStream,
char[] keyPasswd)
Constructs the object from
InputStream which can be used to read
a private key and certificate in PEM keystore format, i.e. |
PEMCredential(java.io.InputStream privateKeyStream,
java.io.InputStream certificateStream,
char[] keyPasswd)
Constructs the object from two
InputStream s which can be used to read
a private key and certificate in PEM format. |
PEMCredential(java.io.InputStream privateKeyStream,
java.io.InputStream certificateStream,
PasswordSupplier pf)
As
PEMCredential(InputStream, InputStream, char[]) but password is retrieved on demand. |
PEMCredential(java.io.InputStream keystoreStream,
PasswordSupplier pf)
As
PEMCredential(InputStream, char[]) but this version allows for providing
decryption key only when needed. |
PEMCredential(java.io.Reader privateKeyReader,
java.io.Reader certificateReader,
char[] keyPasswd)
Constructs the object from two
Reader s which can be used to read
a private key and certificate in PEM format. |
PEMCredential(java.io.Reader privateKeyReader,
java.io.Reader certificateReader,
PasswordSupplier pf)
As
PEMCredential(Reader, Reader, char[]) but password is retrieved on demand. |
PEMCredential(java.lang.String keystorePath,
char[] keyPasswd)
Constructs the object from
InputStream which can be used to read
a private key and certificate in PEM keystore format, i.e. |
PEMCredential(java.lang.String keystorePath,
PasswordSupplier pf)
As
PEMCredential(String, char[]) but this version allows for providing
decryption key only when needed. |
PEMCredential(java.lang.String keyPath,
java.lang.String certificatePath,
char[] keyPasswd)
Constructs the object from two files containing private key and certificate in
PEM format.
|
Modifier and Type | Method and Description |
---|---|
private void |
init(java.io.InputStream privateKeyStream,
java.io.InputStream certificateStream,
PasswordSupplier pf) |
getCertificate, getCertificateChain, getKey, getKeyAlias, getKeyManager, getKeyPassword, getKeyStore, getSubjectName
public PEMCredential(java.lang.String keystorePath, char[] keyPasswd) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
InputStream
which can be used to read
a private key and certificate in PEM keystore format, i.e. the file must contain
both certificates and a private key. See
CertificateUtils.loadPEMKeystore(InputStream, char[], char[])
for details.keystorePath
- file path with the PEM keystorekeyPasswd
- Password used to decrypt the key. May be null if the key
is not encrypted.java.io.IOException
- if the stream can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.lang.String keystorePath, PasswordSupplier pf) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
PEMCredential(String, char[])
but this version allows for providing
decryption key only when needed.keystorePath
- file path with the PEM keystorepf
- object to retrieve password on demand.java.io.IOException
- if the stream can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.io.InputStream keystoreStream, char[] keyPasswd) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
InputStream
which can be used to read
a private key and certificate in PEM keystore format, i.e. the file must contain
both certificates and a private key. See
CertificateUtils.loadPEMKeystore(InputStream, char[], char[])
for details.
The stream is closed after constructing the object.
keystoreStream
- InputStream which can be used to read the PEM keystorekeyPasswd
- Password used to decrypt the key. May be null if the key
is not encrypted.java.io.IOException
- if the stream can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.io.InputStream keystoreStream, PasswordSupplier pf) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
PEMCredential(InputStream, char[])
but this version allows for providing
decryption key only when needed.keystoreStream
- InputStream which can be used to read the PEM keystorepf
- object to retrieve password on demand.java.io.IOException
- if the stream can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.io.InputStream privateKeyStream, java.io.InputStream certificateStream, char[] keyPasswd) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
InputStream
s which can be used to read
a private key and certificate in PEM format.
The streams are closed after constructing the object.
privateKeyStream
- InputStream which can be used to read the private key in PEM formatcertificateStream
- certificate in PEM format InputStreamkeyPasswd
- Password used to decrypt the key. May be null if the key
is not encrypted.java.io.IOException
- if any of the streams can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.io.InputStream privateKeyStream, java.io.InputStream certificateStream, PasswordSupplier pf) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
PEMCredential(InputStream, InputStream, char[])
but password is retrieved on demand.privateKeyStream
- InputStream which can be used to read the private key in PEM formatcertificateStream
- certificate in PEM format InputStreampf
- object to retrieve password on demand.java.io.IOException
- if any of the streams can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.io.Reader privateKeyReader, java.io.Reader certificateReader, char[] keyPasswd) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
Reader
s which can be used to read
a private key and certificate in PEM format.
The streams are closed after constructing the object.
privateKeyReader
- Reader which can be used to read the PEM private keycertificateReader
- certificate file ReaderkeyPasswd
- Password used to decrypt the key. May be null if the key
is not encrypted.java.io.IOException
- if any of files can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.io.Reader privateKeyReader, java.io.Reader certificateReader, PasswordSupplier pf) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
PEMCredential(Reader, Reader, char[])
but password is retrieved on demand.privateKeyReader
- Reader which can be used to read the PEM private keycertificateReader
- certificate file Readerpf
- object to retrieve password on demand.java.io.IOException
- if any of files can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedpublic PEMCredential(java.lang.String keyPath, java.lang.String certificatePath, char[] keyPasswd) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
The streams are closed after constructing the object.
keyPath
- private key file pathcertificatePath
- certificate file pathkeyPasswd
- Password used to decrypt the key. May be null if the key
is not encrypted.java.io.IOException
- if any of files can not be readjava.security.KeyStoreException
- if private key can not be parsed or decryptedjava.security.cert.CertificateException
- if certificate can not be parsedprivate void init(java.io.InputStream privateKeyStream, java.io.InputStream certificateStream, PasswordSupplier pf) throws java.io.IOException, java.security.KeyStoreException, java.security.cert.CertificateException
java.io.IOException
java.security.KeyStoreException
java.security.cert.CertificateException