Package eu.europa.esig.dss.token
Class AbstractKeyStoreTokenConnection
java.lang.Object
eu.europa.esig.dss.token.AbstractSignatureTokenConnection
eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection
- All Implemented Interfaces:
SignatureTokenConnection,AutoCloseable
- Direct Known Subclasses:
AppleSignatureToken,KeyStoreSignatureTokenConnection,MSCAPISignatureToken,Pkcs11SignatureToken
The keyStore token connection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method allows to retrieve a DSSPrivateKeyEntry by aliasgetKey(String alias, KeyStore.PasswordProtection passwordProtection) This method allows to retrieve a DSSPrivateKeyEntry by aliasprotected abstract KeyStore.PasswordProtectionGets the password protectiongetKeys()Retrieves all the available keys (private keys entries) from the token.protected abstract KeyStoreGets the key storevoidsetKeyEntryPredicate(Predicate<DSSPrivateKeyEntry> keyEntryPredicate) Sets a predicate to filter keys to be returned by#getKeys()method.Methods inherited from class eu.europa.esig.dss.token.AbstractSignatureTokenConnection
createPSSParam, getSignatureInstance, sign, sign, sign, signDigest, signDigest, signDigestMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.europa.esig.dss.token.SignatureTokenConnection
close
-
Constructor Details
-
AbstractKeyStoreTokenConnection
protected AbstractKeyStoreTokenConnection()Default constructor
-
-
Method Details
-
setKeyEntryPredicate
Sets a predicate to filter keys to be returned by#getKeys()method. Default :eu.europa.esig.dss.token.predicate.AllPrivateKeyPredicate- returns all keys extracted from the token connection- Parameters:
keyEntryPredicate-PredicateofDSSPrivateKeyEntry, e.g.DSSKeyEntryPredicate
-
getKeyStore
Gets the key store- Returns:
KeyStore- Throws:
DSSException
-
getKeyProtectionParameter
Gets the password protection- Returns:
KeyStore.PasswordProtection
-
getKeys
Description copied from interface:SignatureTokenConnectionRetrieves all the available keys (private keys entries) from the token.- Returns:
- List of encapsulated private keys
- Throws:
DSSException- If there is any problem during the retrieval process
-
getKey
This method allows to retrieve a DSSPrivateKeyEntry by alias- Parameters:
alias- the expected entry alias- Returns:
- the private key or null if the alias does not exist
-
getKey
This method allows to retrieve a DSSPrivateKeyEntry by alias- Parameters:
alias- the expected entry aliaspasswordProtection- key password- Returns:
- the private key or null if the alias does not exist
-