Package eu.emi.security.authn.x509.impl
Class DERCredential
java.lang.Object
eu.emi.security.authn.x509.helpers.AbstractDelegatingX509Credential
eu.emi.security.authn.x509.impl.DERCredential
- All Implemented Interfaces:
X509Credential
Wraps certificate and private key stored in DER format.
- Author:
- K. Benedyczak
-
Field Summary
Fields inherited from class eu.emi.security.authn.x509.helpers.AbstractDelegatingX509Credential
delegate -
Constructor Summary
ConstructorsConstructorDescriptionDERCredential(InputStream privateKeyStream, InputStream certificateStream, char[] keyPasswd) Constructs the object from twoInputStreams which can be used to read a private key and certificate in DER PKCS8 format.DERCredential(String keyPath, String certificatePath, char[] keyPasswd) Constructs the object from two files containing private key and certificate in DER PKCS8 format. -
Method Summary
Methods inherited from class eu.emi.security.authn.x509.helpers.AbstractDelegatingX509Credential
getCertificate, getCertificateChain, getKey, getKeyAlias, getKeyManager, getKeyPassword, getKeyStore, getSubjectName
-
Constructor Details
-
DERCredential
public DERCredential(InputStream privateKeyStream, InputStream certificateStream, char[] keyPasswd) throws IOException, KeyStoreException, CertificateException Constructs the object from twoInputStreams which can be used to read a private key and certificate in DER PKCS8 format.The streams are closed after constructing the object.
- Parameters:
privateKeyStream- InputStream which can be used to read the private key in DER formatcertificateStream- certificate input stream in DER formatkeyPasswd- key password or null if the key is not encrypted- Throws:
IOException- if any of streams can not be readKeyStoreException- if private key can not be parsedCertificateException- if certificate can not be parsed
-
DERCredential
public DERCredential(String keyPath, String certificatePath, char[] keyPasswd) throws IOException, KeyStoreException, CertificateException Constructs the object from two files containing private key and certificate in DER PKCS8 format.The streams are closed after constructing the object.
- Parameters:
keyPath- private key file path in DER formatcertificatePath- certificate file path in DER formatkeyPasswd- key password or null if the key is not encrypted- Throws:
IOException- if any of files can not be readKeyStoreException- if private key can not be parsedCertificateException- if certificate can not be parsed
-