FileDocCategorySizeDatePackage
X500PrivateCredential.javaAPI DocJava SE 5 API3034Fri Aug 26 14:57:48 BST 2005javax.security.auth.x500

X500PrivateCredential

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.

version
1.8, 12/19/03

Fields Summary
private X509Certificate
cert
private PrivateKey
key
private String
alias
Constructors Summary
public X500PrivateCredential(X509Certificate cert, PrivateKey key)
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.

param
cert X509Certificate
param
key PrivateKey for the certificate
exception
IllegalArgumentException if either cert or key is null

	if (cert == null || key == null )
	    throw new IllegalArgumentException();
	this.cert = cert;
	this.key = key;
	this.alias=null;
    
public X500PrivateCredential(X509Certificate cert, PrivateKey key, String alias)
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.

param
cert X509Certificate
param
key PrivateKey for the certificate
param
alias KeyStore alias
exception
IllegalArgumentException if either cert, key or alias is null

	if (cert == null || key == null|| alias == null )
	    throw new IllegalArgumentException();
	this.cert = cert;
	this.key = key;
	this.alias=alias;
    
Methods Summary
public voiddestroy()
Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.

	cert = null;
	key = null;
	alias =null;
    
public java.lang.StringgetAlias()
Returns the KeyStore alias.

return
the KeyStore alias

	return alias;
    
public java.security.cert.X509CertificategetCertificate()
Returns the X.509 certificate.

return
the X509Certificate

	return cert;
    
public java.security.PrivateKeygetPrivateKey()
Returns the PrivateKey.

return
the PrivateKey

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

return
true if X509Certificate and the PrivateKey are null

	return cert == null && key == null && alias==null;