Java™ Platform
Standard Ed. 6

javax.security.auth.x500
Class X500PrivateCredential

java.lang.Object
  extended by 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.


Constructor Summary
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 Summary
 void destroy()
          Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.
 String getAlias()
          Returns the KeyStore alias.
 X509Certificate getCertificate()
          Returns the X.509 certificate.
 PrivateKey getPrivateKey()
          Returns the PrivateKey.
 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

public 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 cert or key is null

X500PrivateCredential

public 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, key or alias is null
Method Detail

getCertificate

public X509Certificate getCertificate()
Returns the X.509 certificate.

Returns:
the X509Certificate

getPrivateKey

public PrivateKey getPrivateKey()
Returns the PrivateKey.

Returns:
the PrivateKey

getAlias

public String getAlias()
Returns the KeyStore alias.

Returns:
the KeyStore alias

destroy

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

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

Java™ Platform
Standard Ed. 6

Submit a bug or feature
For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

Scripting on this page tracks web page traffic, but does not change the content in any way.