javax.security.auth.x500
Class X500PrivateCredential

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.security.auth.x500.X500PrivateCredential
All Implemented Interfaces:
Destroyable sample code for javax.security.auth.Destroyable definition code for javax.security.auth.Destroyable

public final class X500PrivateCredential
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Destroyable sample code for javax.security.auth.Destroyable definition code for javax.security.auth.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.


Constructor Summary
X500PrivateCredential sample code for javax.security.auth.x500.X500PrivateCredential.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey) definition code for javax.security.auth.x500.X500PrivateCredential.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey) (X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate  cert, PrivateKey sample code for java.security.PrivateKey definition code for java.security.PrivateKey  key)
          Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
X500PrivateCredential sample code for javax.security.auth.x500.X500PrivateCredential.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey, java.lang.String) definition code for javax.security.auth.x500.X500PrivateCredential.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey, java.lang.String) (X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate  cert, PrivateKey sample code for java.security.PrivateKey definition code for java.security.PrivateKey  key, String sample code for java.lang.String definition code for java.lang.String  alias)
          Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
 
Method Summary
 void destroy sample code for javax.security.auth.x500.X500PrivateCredential.destroy() definition code for javax.security.auth.x500.X500PrivateCredential.destroy() ()
          Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.
 String sample code for java.lang.String definition code for java.lang.String getAlias sample code for javax.security.auth.x500.X500PrivateCredential.getAlias() definition code for javax.security.auth.x500.X500PrivateCredential.getAlias() ()
          Returns the KeyStore alias.
 X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate getCertificate sample code for javax.security.auth.x500.X500PrivateCredential.getCertificate() definition code for javax.security.auth.x500.X500PrivateCredential.getCertificate() ()
          Returns the X.509 certificate.
 PrivateKey sample code for java.security.PrivateKey definition code for java.security.PrivateKey getPrivateKey sample code for javax.security.auth.x500.X500PrivateCredential.getPrivateKey() definition code for javax.security.auth.x500.X500PrivateCredential.getPrivateKey() ()
          Returns the PrivateKey.
 boolean isDestroyed sample code for javax.security.auth.x500.X500PrivateCredential.isDestroyed() definition code for javax.security.auth.x500.X500PrivateCredential.isDestroyed() ()
          Determines if the references to the X.509 certificate and private key in this object have been cleared.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

X500PrivateCredential sample code for javax.security.auth.x500.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey) definition code for javax.security.auth.x500.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey)

public X500PrivateCredential(X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate  cert,
                             PrivateKey sample code for java.security.PrivateKey definition code for java.security.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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if either cert or key is null

X500PrivateCredential sample code for javax.security.auth.x500.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey, java.lang.String) definition code for javax.security.auth.x500.X500PrivateCredential(java.security.cert.X509Certificate, java.security.PrivateKey, java.lang.String)

public X500PrivateCredential(X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate  cert,
                             PrivateKey sample code for java.security.PrivateKey definition code for java.security.PrivateKey  key,
                             String sample code for java.lang.String definition code for java.lang.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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if either cert, key or alias is null
Method Detail

getCertificate sample code for javax.security.auth.x500.X500PrivateCredential.getCertificate() definition code for javax.security.auth.x500.X500PrivateCredential.getCertificate()

public X509Certificate sample code for java.security.cert.X509Certificate definition code for java.security.cert.X509Certificate  getCertificate()
Returns the X.509 certificate.

Returns:
the X509Certificate

getPrivateKey sample code for javax.security.auth.x500.X500PrivateCredential.getPrivateKey() definition code for javax.security.auth.x500.X500PrivateCredential.getPrivateKey()

public PrivateKey sample code for java.security.PrivateKey definition code for java.security.PrivateKey  getPrivateKey()
Returns the PrivateKey.

Returns:
the PrivateKey

getAlias sample code for javax.security.auth.x500.X500PrivateCredential.getAlias() definition code for javax.security.auth.x500.X500PrivateCredential.getAlias()

public String sample code for java.lang.String definition code for java.lang.String  getAlias()
Returns the KeyStore alias.

Returns:
the KeyStore alias

destroy sample code for javax.security.auth.x500.X500PrivateCredential.destroy() definition code for javax.security.auth.x500.X500PrivateCredential.destroy()

public void destroy()
Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.

Specified by:
destroy sample code for javax.security.auth.Destroyable.destroy() definition code for javax.security.auth.Destroyable.destroy() in interface Destroyable sample code for javax.security.auth.Destroyable definition code for javax.security.auth.Destroyable

isDestroyed sample code for javax.security.auth.x500.X500PrivateCredential.isDestroyed() definition code for javax.security.auth.x500.X500PrivateCredential.isDestroyed()

public boolean isDestroyed()
Determines if the references to the X.509 certificate and private key in this object have been cleared.

Specified by:
isDestroyed sample code for javax.security.auth.Destroyable.isDestroyed() definition code for javax.security.auth.Destroyable.isDestroyed() in interface Destroyable sample code for javax.security.auth.Destroyable definition code for javax.security.auth.Destroyable
Returns:
true if X509Certificate and the PrivateKey are null