public final class X500PrivateCredential extends Object implements Destroyable
X509Certificate and its corresponding PrivateKey, with an optional keystore alias.| Constructor and Description |
|---|
X500PrivateCredential(X509Certificate certificate,
PrivateKey key)
Creates a new private credential with no associated keystore alias.
|
X500PrivateCredential(X509Certificate certificate,
PrivateKey key,
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.
|
String |
getAlias()
Returns the keystore alias of this credential, or null if not present.
|
X509Certificate |
getCertificate()
Returns the certificate of this credential.
|
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(X509Certificate certificate, PrivateKey key)
certificate - The X.509 certificate.key - The private key.IllegalArgumentException - If either parameter is null.public X500PrivateCredential(X509Certificate certificate, PrivateKey key, String alias)
certificate - The X.509 certificate.key - The private key.alias - The keystore alias for this credential.IllegalArgumentException - If any parameter is null.public X509Certificate getCertificate()
public PrivateKey getPrivateKey()
public String getAlias()
public void destroy()
destroy in interface Destroyablepublic boolean isDestroyed()
isDestroyed in interface Destroyable