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 TypeMethodDescriptionvoid
destroy()
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.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 TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
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 eithercert
orkey
is 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
,key
oralias
is 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:
destroy
in 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:
isDestroyed
in interfaceDestroyable
- Returns:
- true if X509Certificate and the PrivateKey are null
-