public final class X500PrivateCredential extends java.lang.Object implements javax.security.auth.Destroyable
X509Certificate and its corresponding PrivateKey, with an optional keystore alias.| Constructor and Description |
|---|
X500PrivateCredential(java.security.cert.X509Certificate certificate,
java.security.PrivateKey key)
Creates a new private credential with no associated keystore alias.
|
X500PrivateCredential(java.security.cert.X509Certificate certificate,
java.security.PrivateKey key,
java.lang.String alias)
Creates a new private credential with a keystore alias.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the sensitive data of this credential, setting the certificate,
private key, and keystore alias to null.
|
java.lang.String |
getAlias()
Returns the keystore alias of this credential, or null if not present.
|
java.security.cert.X509Certificate |
getCertificate()
Returns the certificate of this credential.
|
java.security.PrivateKey |
getPrivateKey()
Returns the private key of this credential.
|
boolean |
isDestroyed()
Tells whether or not this credential has been destroyed, and that
the certificate and private key fields are null.
|
public X500PrivateCredential(java.security.cert.X509Certificate certificate, java.security.PrivateKey key)
certificate - The X.509 certificate.key - The private key.java.lang.IllegalArgumentException - If either parameter is null.public X500PrivateCredential(java.security.cert.X509Certificate certificate, java.security.PrivateKey key, java.lang.String alias)
certificate - The X.509 certificate.key - The private key.alias - The keystore alias for this credential.java.lang.IllegalArgumentException - If any parameter is null.public java.security.cert.X509Certificate getCertificate()
public java.security.PrivateKey getPrivateKey()
public java.lang.String getAlias()
public void destroy()
destroy in interface javax.security.auth.Destroyablepublic boolean isDestroyed()
isDestroyed in interface javax.security.auth.Destroyable