public class ZebraP12Info
extends Object
| Constructor and Description |
|---|
ZebraP12Info(java.io.InputStream pkcs12Stream,
String p12Password)
Creates a wrapper that opens up the provided certificate keystore stream.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<String> |
getAliases()
Get a list of aliases present in the certificate keystore.
|
String |
getCaCommonName()
Get the common name of the CA associated with the certificate file.
|
String |
getCaCommonName(String alias)
Get the common name of the CA associated with the certificate file.
|
String |
getCaContent()
Get the content of the ca, which is determined to be all entries in the certificate chain after the first entry.
|
String |
getCaContent(String alias)
Get the content of the ca, which is determined to be all entries in the certificate chain after the first entry.
|
java.util.Date |
getCaExpirationDate()
Get the expiration data of the CA associated with the certificate file.
|
java.util.Date |
getCaExpirationDate(String alias)
Get the expiration data of the CA associated with the certificate file.
|
String |
getCertificateCommonName()
Get the common name of the client certificate associated with the certificate file.
|
String |
getCertificateCommonName(String alias)
Get the common name of the client certificate associated with the certificate file.
|
String |
getCertificateContent()
Get the content of the first entry in the certificate's certificate chain.
|
String |
getCertificateContent(String alias)
Get the content of the first entry in the certificate's certificate chain.
|
java.util.Date |
getCertificateExpirationDate()
Get the expiration data of the client certificate associated with the certificate file.
|
java.util.Date |
getCertificateExpirationDate(String alias)
Get the expiration data of the client certificate associated with the certificate file.
|
String |
getCertificateIssuer()
Get the issuer of the client certificate.
|
String |
getCertificateIssuer(String alias)
Get the issuer of the client certificate.
|
String |
getEncryptedPrivateKeyContent(String passwordToEncryptKey,
String p12Password)
Get the encrypted private key content.
|
String |
getEncryptedPrivateKeyContent(String alias,
String passwordToEncryptKey,
String p12Password)
Get the encrypted private key content.
|
java.security.KeyStore |
getKeyStore()
Get the keystore of the processed client certificate.
|
String |
getPrivateKeyAlgorithm(String p12Password)
Get the algorithm used by the private key.
|
String |
getPrivateKeyAlgorithm(String alias,
String p12Password)
Get the algorithm used by the private key.
|
String |
getPrivateKeyFormat(String p12Password)
Get the format of the private key.
|
String |
getPrivateKeyFormat(String alias,
String p12Password)
Get the format of the private key.
|
public ZebraP12Info(java.io.InputStream pkcs12Stream,
String p12Password)
throws ZebraCertificateException
pkcs12Stream - the stream containing certificate keystore file contentsp12Password - the password used to access the certificate fileZebraCertificateException - thrown if the certificate stream contents cannot be accessed or if the
certificate password was incorrectpublic java.util.List<String> getAliases()
throws ZebraCertificateException
ZebraCertificateException - if the keystore has not been initialized (loaded)public String getCertificateContent()
throws ZebraCertificateException
ZebraCertificateException - if the provided alias does not exist or the certificate content is corruptpublic String getCertificateContent(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the provided alias does not exist or the certificate content is corruptpublic String getCaContent()
throws ZebraCertificateException
ZebraCertificateException - if the provided alias does not exist or the ca content is corruptpublic String getCaContent(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the provided alias does not exist or the ca content is corruptpublic String getEncryptedPrivateKeyContent(String passwordToEncryptKey,
String p12Password)
throws ZebraCertificateException
passwordToEncryptKey - the password used to encrypt the resulting private keyp12Password - the password used to access the certificate fileZebraCertificateException - if the provided alias does not exist, certificate password is incorrect, or
private key content is corruptpublic String getEncryptedPrivateKeyContent(String alias,
String passwordToEncryptKey,
String p12Password)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate filepasswordToEncryptKey - the password used to encrypt the resulting private keyp12Password - the password used to access the certificate fileZebraCertificateException - if the provided alias does not exist, certificate password is incorrect, or
private key content is corruptpublic String getCertificateCommonName()
throws ZebraCertificateException
ZebraCertificateException - if the provided alias does not exist or the underlying certificate could not be
parsed.public String getCertificateCommonName(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the provided alias does not exist or the underlying certificate could not be
parsed.public String getCaCommonName()
throws ZebraCertificateException
ZebraCertificateException - if the provided alias does not exist or the underlying certificate could not be
parsed.public String getCaCommonName(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the provided alias does not exist or the underlying certificate could not be
parsed.public java.util.Date getCertificateExpirationDate()
throws ZebraCertificateException
ZebraCertificateException - if the certificate keystore is invalid or the provided alias does not exist in
the certificate keystore.public java.util.Date getCertificateExpirationDate(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the certificate keystore is invalid or the provided alias does not exist in
the certificate keystore.public java.util.Date getCaExpirationDate()
throws ZebraCertificateException
ZebraCertificateException - if the certificate keystore is invalid or the provided alias does not exist in
the certificate keystore.public java.util.Date getCaExpirationDate(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the certificate keystore is invalid or the provided alias does not exist in
the certificate keystore.public String getPrivateKeyAlgorithm(String p12Password)
throws ZebraCertificateException
p12Password - the password used to access the certificate fileZebraCertificateException - if the provided certificate file is invalid, alias does not exist, or contained
private key is corrupt or unsupported.public String getPrivateKeyAlgorithm(String alias,
String p12Password)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate filep12Password - the password used to access the certificate fileZebraCertificateException - if the provided certificate file is invalid, alias does not exist, or contained
private key is corrupt or unsupported.public String getPrivateKeyFormat(String p12Password)
throws ZebraCertificateException
p12Password - the password used to access the certificate fileZebraCertificateException - if the provided certificate file is invalid, alias does not exist, or contained
private key is corrupt or unsupported.public String getPrivateKeyFormat(String alias,
String p12Password)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate filep12Password - the password used to access the certificate fileZebraCertificateException - if the provided certificate file is invalid, alias does not exist, or contained
private key is corrupt or unsupported.public String getCertificateIssuer()
throws ZebraCertificateException
ZebraCertificateException - if the provided certificate file is invalid, alias does not exist, or contained
private key is corrupt or unsupported.public String getCertificateIssuer(String alias)
throws ZebraCertificateException
alias - the alias name of the specific entry to extract from the certificate fileZebraCertificateException - if the provided certificate file is invalid, alias does not exist, or contained
private key is corrupt or unsupported.public java.security.KeyStore getKeyStore()
© 2017 ZIH Corp. All Rights Reserved.