Package eu.emi.security.authn.x509.impl
Class KeyAndCertCredential
java.lang.Object
eu.emi.security.authn.x509.helpers.AbstractX509Credential
eu.emi.security.authn.x509.impl.KeyAndCertCredential
- All Implemented Interfaces:
X509Credential
Wraps a
PrivateKey and X509Certificate chain as a X509Credential.
This class is especially useful for quick, in-memory creation of KeyStore when
key and certificate are already loaded.
- Author:
- K. Benedyczak
-
Field Summary
Fields inherited from class eu.emi.security.authn.x509.helpers.AbstractX509Credential
ALIAS, KEY_PASSWD, ks -
Constructor Summary
ConstructorsConstructorDescriptionKeyAndCertCredential(PrivateKey privateKey, X509Certificate[] certificateChain) Creates a new instance from the provided key and certificates. -
Method Summary
Methods inherited from class eu.emi.security.authn.x509.helpers.AbstractX509Credential
getCertificate, getCertificateChain, getKey, getKeyAlias, getKeyManager, getKeyPassword, getKeyStore, getSubjectName
-
Constructor Details
-
KeyAndCertCredential
public KeyAndCertCredential(PrivateKey privateKey, X509Certificate[] certificateChain) throws KeyStoreException Creates a new instance from the provided key and certificates.- Parameters:
privateKey- private key to be placed in thisX509Credential's KeyStorecertificateChain- certificates to be placed in thisX509Credential's KeyStore. those certificates must match the provided privateKey. The user's certificate is assumed to be the first entry in the chain.- Throws:
KeyStoreException- if private key is invalid or doesn't match the certificate.
-