javax.security.auth.x500

Class X500PrivateCredential

  1. java.lang.Object
  2. extended byjavax.security.auth.x500.X500PrivateCredential
All implemented interfaces:
Destroyable

  1. public final class X500PrivateCredential
  2. extends java.lang.Object
  3. 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.


Constructor Summary

Constructor and Description
X500PrivateCredential(java.security.cert.X509Certificate cert,java.security.PrivateKey key)
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
X500PrivateCredential(java.security.cert.X509Certificate cert,java.security.PrivateKey key,java.lang.String alias)
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.

Method Summary

Modifier and Type Method and Description
  1. void
destroy()
Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.
  1. java.lang.String
getAlias()
Returns the KeyStore alias.
  1. java.security.cert.X509Certificate
getCertificate()
Returns the X.509 certificate.
  1. java.security.PrivateKey
getPrivateKey()
Returns the PrivateKey.
  1. boolean
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

X500PrivateCredential

  1. public X500PrivateCredential(java.security.cert.X509Certificate cert,
  2. 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:
java.lang.IllegalArgumentException - if either cert or key is null

X500PrivateCredential

  1. public X500PrivateCredential(java.security.cert.X509Certificate cert,
  2. java.security.PrivateKey key,
  3. 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:
java.lang.IllegalArgumentException - if either cert, key or alias is null

Method Detail

getCertificate

  1. public java.security.cert.X509Certificate getCertificate( )
Returns the X.509 certificate.

Returns:
the X509Certificate

getPrivateKey

  1. public java.security.PrivateKey getPrivateKey( )
Returns the PrivateKey.

Returns:
the PrivateKey

getAlias

  1. public java.lang.String getAlias( )
Returns the KeyStore alias.

Returns:
the KeyStore alias

destroy

  1. public void destroy()
Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.
Specified by:
destroy in interface Destroyable

isDestroyed

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

Specified by:
isDestroyed in interface Destroyable
Returns:
true if X509Certificate and the PrivateKey are null