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
-
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.PasswordProtection
Gets the password protectiongetKeys()
Retrieves all the available keys (private keys entries) from the token.protected abstract KeyStore
Gets the key storevoid
setKeyEntryPredicate
(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, signDigest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-Predicate
ofDSSPrivateKeyEntry
, 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:SignatureTokenConnection
Retrieves 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
-