public abstract class CertificateManager extends Object
| Constructor and Description |
|---|
CertificateManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract X509Certificate |
createCertificate(PrivateKey caPrivateKey,
X509Certificate caCertificate,
PublicKey publicKey,
String subject,
BigInteger serialNumber,
long lifetime)
This method creates a new X509 certificate that is signed by a certificate authority (CA).
|
abstract X509Certificate |
createCertificateAuthority(PrivateKey privateKey,
PublicKey publicKey,
String subject,
BigInteger serialNumber,
long lifetime)
This method creates a new self-signed X509 certificate for a new certificate authority (CA).
|
KeyStore |
createPkcs12KeyStore(String keyName,
char[] password,
PrivateKey privateKey,
List<X509Certificate> certificates)
This method creates a new PKCS12 format key store containing a named private key and public certificate chain.
|
KeyStore |
createPkcs12KeyStore(String keyName,
char[] password,
PrivateKey privateKey,
X509Certificate certificate)
This method creates a new PKCS12 format key store containing a named private key and public certificate.
|
abstract X509Certificate |
decodeCertificate(String pem)
This method decodes an X509 format certificate from a PEM string.
|
KeyStore |
decodeKeyStore(String base64String,
char[] password)
This method decodes a PKCS12 format key store from its encrypted byte stream.
|
abstract String |
encodeCertificate(X509Certificate certificate)
This method encodes an X509 format certificate into a PEM string.
|
String |
encodeKeyStore(KeyStore keyStore,
char[] password)
This method encodes a PKCS12 format key store into a base 64 string format.
|
X509Certificate |
retrieveCertificate(KeyStore keyStore,
String certificateName)
This method retrieves a public certificate from a key store.
|
KeyStore |
retrieveKeyStore(InputStream input,
char[] password)
This method retrieves a PKCS12 format key store from an input stream.
|
PrivateKey |
retrievePrivateKey(KeyStore keyStore,
String keyName,
char[] password)
This method retrieves a private key from a key store.
|
void |
saveKeyStore(OutputStream output,
KeyStore keyStore,
char[] password)
This method saves a PKCS12 format key store out to an output stream.
|
public final void saveKeyStore(OutputStream output, KeyStore keyStore, char[] password) throws IOException
output - The output stream to be written to.keyStore - The PKCS12 format key store.password - The password that should be used to encrypt the file.IOException - Unable to save the key store to the specified output stream.public final KeyStore retrieveKeyStore(InputStream input, char[] password) throws IOException
input - The input stream from which to read the key store.password - The password that was used to encrypt the file.IOException - Unable to retrieve the key store from the specified input stream.public final X509Certificate retrieveCertificate(KeyStore keyStore, String certificateName)
keyStore - The key store containing the certificate.certificateName - The name (alias) of the certificate.public final PrivateKey retrievePrivateKey(KeyStore keyStore, String keyName, char[] password)
keyStore - The key store containing the private key.keyName - The name (alias) of the private key.password - The password used to encrypt the private key.public abstract X509Certificate createCertificateAuthority(PrivateKey privateKey, PublicKey publicKey, String subject, BigInteger serialNumber, long lifetime)
privateKey - The private key for the new certificate.publicKey - The public key that the new certificate is encoding.subject - The distinguished name for the certificate (e.g. CN=Derk Norton, O=Crater Dog Technologies).serialNumber - The unique serial number for the new certificate.lifetime - The number of milliseconds before the certificate should expire.public abstract X509Certificate createCertificate(PrivateKey caPrivateKey, X509Certificate caCertificate, PublicKey publicKey, String subject, BigInteger serialNumber, long lifetime)
caPrivateKey - The private key for the certificate authority.caCertificate - The public certificate for the certificate authority.publicKey - The public key that the new certificate is encoding.subject - The distinguished name for the certificate (e.g. CN=Derk Norton, O=Crater Dog Technologies).serialNumber - The unique serial number for the new certificate.lifetime - The number of milliseconds before the certificate should expire.public final KeyStore createPkcs12KeyStore(String keyName, char[] password, PrivateKey privateKey, X509Certificate certificate)
keyName - The name of the private key and public certificate.password - The password used to encrypt the private key.privateKey - The private key.certificate - The X509 format public certificate.public final KeyStore createPkcs12KeyStore(String keyName, char[] password, PrivateKey privateKey, List<X509Certificate> certificates)
keyName - The name of the private key and public certificate.password - The password used to encrypt the private key.privateKey - The private key.certificates - The chain of X509 format public certificates.public abstract String encodeCertificate(X509Certificate certificate)
certificate - The X509 format certificate.public abstract X509Certificate decodeCertificate(String pem)
pem - The PEM string for the certificate.public final String encodeKeyStore(KeyStore keyStore, char[] password)
keyStore - The PKCS12 format key store to be encoded.password - The password to be used to encrypt the byte stream.public final KeyStore decodeKeyStore(String base64String, char[] password)
base64String - The base 64 encoded, password encrypted PKCS12 byte stream.password - The password that was used to encrypt the byte stream.Copyright © 2016 Crater Dog Technologies(TM). All rights reserved.