Package eu.europa.esig.dss.token
Class KeyStoreSignatureTokenConnection
java.lang.Object
eu.europa.esig.dss.token.AbstractSignatureTokenConnection
eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection
eu.europa.esig.dss.token.KeyStoreSignatureTokenConnection
- All Implemented Interfaces:
SignatureTokenConnection,AutoCloseable
- Direct Known Subclasses:
JKSSignatureToken,Pkcs12SignatureToken
Connection to a key store
-
Constructor Summary
ConstructorsConstructorDescriptionKeyStoreSignatureTokenConnection(byte[] ksBytes, String ksType, KeyStore.PasswordProtection ksPassword) Constructor from keyStore's binariesKeyStoreSignatureTokenConnection(File ksFile, String ksType, KeyStore.PasswordProtection ksPassword) Constructor from a fileKeyStoreSignatureTokenConnection(InputStream ksStream, String ksType, KeyStore.PasswordProtection password) Construct a KeyStoreSignatureTokenConnection object.KeyStoreSignatureTokenConnection(String filepath, String ksType, KeyStore.PasswordProtection ksPassword) Constructor with a path to KeyStore -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected KeyStore.PasswordProtectionGets the password protectionprotected KeyStoreGets the key storeMethods inherited from class eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection
getKey, getKey, getKeys, setKeyEntryPredicateMethods inherited from class eu.europa.esig.dss.token.AbstractSignatureTokenConnection
createPSSParam, getSignatureInstance, sign, sign, sign, signDigest, signDigest, signDigest
-
Constructor Details
-
KeyStoreSignatureTokenConnection
public KeyStoreSignatureTokenConnection(byte[] ksBytes, String ksType, KeyStore.PasswordProtection ksPassword) Constructor from keyStore's binaries- Parameters:
ksBytes- byte array representing the keyStoreksType-Stringtype of the keyStoreksPassword-KeyStore.PasswordProtection
-
KeyStoreSignatureTokenConnection
public KeyStoreSignatureTokenConnection(String filepath, String ksType, KeyStore.PasswordProtection ksPassword) throws IOException Constructor with a path to KeyStore- Parameters:
filepath-Stringpath to the KeyStoreksType-Stringtype of the keyStoreksPassword-KeyStore.PasswordProtection- Throws:
IOException- if an exception occurs
-
KeyStoreSignatureTokenConnection
public KeyStoreSignatureTokenConnection(File ksFile, String ksType, KeyStore.PasswordProtection ksPassword) throws IOException Constructor from a file- Parameters:
ksFile-Fileto the KeyStoreksType-Stringtype of the keyStoreksPassword-KeyStore.PasswordProtection- Throws:
IOException- if an exception occurs
-
KeyStoreSignatureTokenConnection
public KeyStoreSignatureTokenConnection(InputStream ksStream, String ksType, KeyStore.PasswordProtection password) Construct a KeyStoreSignatureTokenConnection object. Please note that the keystore password will also be used to retrieve the private key. For each keystore entry (identifiable by alias) the same private key password will be used. If you want to specify a separate private key password use theAbstractKeyStoreTokenConnection.getKey(String, PasswordProtection)method.- Parameters:
ksStream- the inputstream which contains the keystoreksType- the keystore typepassword- the keystore password
-
-
Method Details
-
getKeyStore
Description copied from class:AbstractKeyStoreTokenConnectionGets the key store- Specified by:
getKeyStorein classAbstractKeyStoreTokenConnection- Returns:
KeyStore
-
getKeyProtectionParameter
Description copied from class:AbstractKeyStoreTokenConnectionGets the password protection- Specified by:
getKeyProtectionParameterin classAbstractKeyStoreTokenConnection- Returns:
KeyStore.PasswordProtection
-
close
public void close()
-