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.
public X500PrivateCredential(X509Certificate cert, PrivateKey key)
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
cert
- X509Certificatekey
- PrivateKey for the certificateIllegalArgumentException
- if either cert
or key
is nullpublic X500PrivateCredential(X509Certificate cert, PrivateKey key, String alias)
Creates an X500PrivateCredential that associates an X.509 certificate, a private key and the KeyStore alias.
cert
- X509Certificatekey
- PrivateKey for the certificatealias
- KeyStore aliasIllegalArgumentException
- if either cert
, key
or alias
is nullpublic X509Certificate getCertificate()
Returns the X.509 certificate.
public PrivateKey getPrivateKey()
Returns the PrivateKey.
public String getAlias()
Returns the KeyStore alias.
public void destroy()
Clears the references to the X.509 certificate, private key and the KeyStore alias in this object.
destroy
in interface Destroyable
public boolean isDestroyed()
Determines if the references to the X.509 certificate and private key in this object have been cleared.
isDestroyed
in interface Destroyable
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.