Class X500PrivateCredential

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 Summary

    Constructors
    Constructor
    Description
    Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
    Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.
    Returns the KeyStore alias.
    Returns the X.509 certificate.
    Returns the PrivateKey.
    boolean
    Determines if the references to the X.509 certificate and private key in this object have been cleared.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • 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 Details

    • 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