Class X500PrivateCredential
java.lang.Object
javax.security.auth.x500.X500PrivateCredential
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionX500PrivateCredential(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
Modifier and TypeMethodDescriptionvoiddestroy()Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.getAlias()Returns the KeyStore alias.Returns the X.509 certificate.Returns the PrivateKey.booleanDetermines 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, waitModifier and TypeMethodDescriptionprotected Objectclone()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.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(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 bynotifyornotifyAll) or the expiration of the timeout.final voidwait(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 bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
X500PrivateCredential
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.- Parameters:
cert- X509Certificatekey- PrivateKey for the certificate- Throws:
IllegalArgumentException- if eithercertorkeyis null
-
X500PrivateCredential
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.- Parameters:
cert- X509Certificatekey- PrivateKey for the certificatealias- KeyStore alias- Throws:
IllegalArgumentException- if eithercert,keyoraliasis null
-
-
Method Details
-
getCertificate
-
getPrivateKey
-
getAlias
-
destroy
public void destroy()Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()Determines if the references to the X.509 certificate and private key in this object have been cleared.- Specified by:
isDestroyedin interfaceDestroyable- Returns:
- true if X509Certificate and the PrivateKey are null
-