- java.lang.Object
- 
- javax.security.auth.x500.X500PrivateCredential
 
- 
- All Implemented Interfaces:
- Destroyable
 
 public final class X500PrivateCredential extends Object implements Destroyable This class represents an X500PrivateCredential. It associates an X.509 certificate, corresponding private key and the KeyStore alias used to reference that exact key pair in the KeyStore. This enables looking up the private credentials for an X.500 principal in a subject.- Since:
- 1.4
 
- 
- 
Constructor SummaryConstructors Constructor Description X500PrivateCredential(X509Certificate cert, PrivateKey key)Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.X500PrivateCredential(X509Certificate cert, PrivateKey key, String alias)Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.StringgetAlias()Returns the KeyStore alias.X509CertificategetCertificate()Returns the X.509 certificate.PrivateKeygetPrivateKey()Returns the PrivateKey.booleanisDestroyed()Determines if the references to the X.509 certificate and private key in this object have been cleared.
 
- 
- 
- 
Constructor Detail- 
X500PrivateCredentialpublic X500PrivateCredential(X509Certificate cert, PrivateKey key) Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.- Parameters:
- cert- X509Certificate
- key- PrivateKey for the certificate
- Throws:
- IllegalArgumentException- if either- certor- keyis null
 
 - 
X500PrivateCredentialpublic X500PrivateCredential(X509Certificate cert, PrivateKey key, String alias) Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.- Parameters:
- cert- X509Certificate
- key- PrivateKey for the certificate
- alias- KeyStore alias
- Throws:
- IllegalArgumentException- if either- cert,- keyor- aliasis null
 
 
- 
 - 
Method Detail- 
getCertificatepublic X509Certificate getCertificate() Returns the X.509 certificate.- Returns:
- the X509Certificate
 
 - 
getPrivateKeypublic PrivateKey getPrivateKey() Returns the PrivateKey.- Returns:
- the PrivateKey
 
 - 
getAliaspublic String getAlias() Returns the KeyStore alias.- Returns:
- the KeyStore alias
 
 - 
destroypublic void destroy() Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.- Specified by:
- destroyin interface- Destroyable
 
 - 
isDestroyedpublic boolean isDestroyed() Determines if the references to the X.509 certificate and private key in this object have been cleared.- Specified by:
- isDestroyedin interface- Destroyable
- Returns:
- true if X509Certificate and the PrivateKey are null
 
 
- 
 
-