- 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.
-
-
Constructor Summary
Constructors Constructor and Description 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
Methods Modifier and Type Method and Description 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.
-
-
-
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
- X509Certificatekey
- PrivateKey for the certificate- Throws:
IllegalArgumentException
- if eithercert
orkey
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
- X509Certificatekey
- PrivateKey for the certificatealias
- KeyStore alias- Throws:
IllegalArgumentException
- if eithercert
,key
oralias
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 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
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/security/auth/x500/x500privatecredential.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.