public class CertificateBundle extends Certificate
KeySpec respective X509Certificate object. Supports creation of
key stores that contain the key and the certificate
chain.getPrivateKeySpec(),
Certificate.getX509Certificate(),
Certificate.getIssuingCaCertificate(),
PemObject| Modifier and Type | Method and Description |
|---|---|
KeyStore |
createKeyStore(String keyAlias)
Create a
KeyStore from this CertificateBundle containing the
private key and certificate chain. |
KeyStore |
createKeyStore(String keyAlias,
boolean includeCaChain)
Create a
KeyStore from this CertificateBundle containing the
private key and certificate chain. |
KeyStore |
createKeyStore(String keyAlias,
boolean includeCaChain,
char[] password)
Create a
KeyStore from this CertificateBundle containing the
private key and certificate chain. |
KeyStore |
createKeyStore(String keyAlias,
boolean includeCaChain,
CharSequence password)
Create a
KeyStore from this CertificateBundle containing the
private key and certificate chain. |
KeyStore |
createKeyStore(String keyAlias,
char[] password)
Create a
KeyStore from this CertificateBundle containing the
private key and certificate chain. |
KeyStore |
createKeyStore(String keyAlias,
CharSequence password)
Create a
KeyStore from this CertificateBundle containing the
private key and certificate chain. |
String |
getPrivateKey() |
KeySpec |
getPrivateKeySpec()
Retrieve the private key as
KeySpec. |
String |
getPrivateKeyType() |
String |
getRequiredPrivateKeyType() |
List<X509Certificate> |
getX509IssuerCertificates()
Retrieve the issuing CA certificates as list of
X509Certificate. |
static CertificateBundle |
of(String serialNumber,
String certificate,
String issuingCaCertificate,
String privateKey)
Create a
CertificateBundle given a private key with certificates and the
serial number. |
static CertificateBundle |
of(String serialNumber,
String certificate,
String issuingCaCertificate,
String privateKey,
String privateKeyType)
Create a
CertificateBundle given a private key with certificates and the
serial number. |
createTrustStore, getCertificate, getIssuingCaCertificate, getSerialNumber, getX509Certificate, getX509IssuerCertificate, ofpublic static CertificateBundle of(String serialNumber, String certificate, String issuingCaCertificate, String privateKey)
CertificateBundle given a private key with certificates and the
serial number.serialNumber - must not be empty or null.certificate - must not be empty or null.issuingCaCertificate - must not be empty or null.privateKey - must not be empty or null.CertificateBundle instead.public static CertificateBundle of(String serialNumber, String certificate, String issuingCaCertificate, String privateKey, @Nullable String privateKeyType)
CertificateBundle given a private key with certificates and the
serial number.serialNumber - must not be empty or null.certificate - must not be empty or null.issuingCaCertificate - must not be empty or null.privateKey - must not be empty or null.privateKeyType - must not be empty or null.CertificateBundlepublic String getPrivateKey()
@Nullable public String getPrivateKeyType()
public String getRequiredPrivateKeyType()
IllegalStateException - if the private key type is nullpublic KeySpec getPrivateKeySpec()
KeySpec.KeySpec. KeyFactory can generate
a PrivateKey from this KeySpec.public KeyStore createKeyStore(String keyAlias)
KeyStore from this CertificateBundle containing the
private key and certificate chain.keyAlias - the key alias to use.KeyStore containing the private key and certificate chain.public KeyStore createKeyStore(String keyAlias, CharSequence password)
KeyStore from this CertificateBundle containing the
private key and certificate chain.keyAlias - the key alias to use.password - the password to use.KeyStore containing the private key and certificate chain.public KeyStore createKeyStore(String keyAlias, char[] password)
KeyStore from this CertificateBundle containing the
private key and certificate chain.keyAlias - the key alias to use.password - the password to use.KeyStore containing the private key and certificate chain.public KeyStore createKeyStore(String keyAlias, boolean includeCaChain)
KeyStore from this CertificateBundle containing the
private key and certificate chain.keyAlias - the key alias to use.includeCaChain - whether to include the certificate authority chain instead of
just the issuer certificate.KeyStore containing the private key and certificate chain.public KeyStore createKeyStore(String keyAlias, boolean includeCaChain, CharSequence password)
KeyStore from this CertificateBundle containing the
private key and certificate chain.keyAlias - the key alias to use.includeCaChain - whether to include the certificate authority chain instead of
just the issuer certificate.password - the password to use.KeyStore containing the private key and certificate chain.public KeyStore createKeyStore(String keyAlias, boolean includeCaChain, char[] password)
KeyStore from this CertificateBundle containing the
private key and certificate chain.keyAlias - the key alias to use.includeCaChain - whether to include the certificate authority chain instead of
just the issuer certificate.password - the password to use.KeyStore containing the private key and certificate chain.public List<X509Certificate> getX509IssuerCertificates()
X509Certificate.X509Certificate.Copyright © 2016–2022 Pivotal Software, Inc.. All rights reserved.