Package eu.europa.esig.dss.token
Class Pkcs11SignatureToken
java.lang.Object
eu.europa.esig.dss.token.AbstractSignatureTokenConnection
eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection
eu.europa.esig.dss.token.Pkcs11SignatureToken
- All Implemented Interfaces:
- SignatureTokenConnection,- AutoCloseable
public class Pkcs11SignatureToken extends AbstractKeyStoreTokenConnection
PKCS11 token with callback
- 
Field Summary
- 
Constructor SummaryConstructors Constructor Description Pkcs11SignatureToken(String pkcs11Path)Create the SignatureTokenConnection, using the provided path for the library.Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback)Create the SignatureTokenConnection, using the provided path for the library and a way of retrieving the password from the user.Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, int slotId)Sometimes, multiple SmartCard reader is connected.Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, int slotId, int slotListIndex, String extraPkcs11Config)Sometimes, multiple SmartCard reader is connected.Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, int slotId, String extraPkcs11Config)Sometimes, multiple SmartCard reader is connected.Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, String extraPkcs11Config)Create the SignatureTokenConnection, using the provided path for the library and a way of retrieving the password from the user.Pkcs11SignatureToken(String pkcs11Path, String extraPkcs11Config)Create the SignatureTokenConnection, using the provided path for the library.Pkcs11SignatureToken(String pkcs11Path, KeyStore.PasswordProtection password)Sometimes, the password is known in advance.Pkcs11SignatureToken(String pkcs11Path, KeyStore.PasswordProtection password, int slotId)Sometimes, multiple SmartCard reader is connected.Pkcs11SignatureToken(String pkcs11Path, KeyStore.PasswordProtection password, int slotId, String extraPkcs11Config)Sometimes, multiple SmartCard reader is connected.Pkcs11SignatureToken(String pkcs11Path, KeyStore.PasswordProtection password, String extraPkcs11Config)Sometimes, the password is known in advance.
- 
Method SummaryModifier and Type Method Description protected StringbuildConfig()voidclose()protected StringescapePath(String pathToEscape)protected StringgetPkcs11Path()protected ProvidergetProvider()protected SignaturegetSignatureInstance(String javaSignatureAlgorithm)Methods inherited from class eu.europa.esig.dss.token.AbstractKeyStoreTokenConnectiongetKey, getKey, getKeysMethods inherited from class eu.europa.esig.dss.token.AbstractSignatureTokenConnectioncreatePSSParam, sign, sign, signDigest, signDigest
- 
Constructor Details- 
Pkcs11SignatureTokenCreate the SignatureTokenConnection, using the provided path for the library.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
 
- 
Pkcs11SignatureTokenCreate the SignatureTokenConnection, using the provided path for the library.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- extraPkcs11Config- extra configuration for pkcs11 library
 
- 
Pkcs11SignatureTokenSometimes, the password is known in advance. This create a SignatureTokenConnection and the keys will be accessed using the provided password. The default constructor for CallbackPkcs11SignatureToken.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- password- the pin code / password to use
 
- 
Pkcs11SignatureTokenpublic Pkcs11SignatureToken(String pkcs11Path, KeyStore.PasswordProtection password, String extraPkcs11Config)Sometimes, the password is known in advance. This create a SignatureTokenConnection and the keys will be accessed using the provided password. The default constructor for CallbackPkcs11SignatureToken.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- password- the pin code / password to use
- extraPkcs11Config- extra configuration for pkcs11 library
 
- 
Pkcs11SignatureTokenCreate the SignatureTokenConnection, using the provided path for the library and a way of retrieving the password from the user. The default constructor for CallbackPkcs11SignatureToken.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- callback- the callback to enter the pin code / password
 
- 
Pkcs11SignatureTokenpublic Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, String extraPkcs11Config)Create the SignatureTokenConnection, using the provided path for the library and a way of retrieving the password from the user. The default constructor for CallbackPkcs11SignatureToken.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- callback- the callback to enter the pin code / password
- extraPkcs11Config- extra configuration for pkcs11 library
 
- 
Pkcs11SignatureTokenSometimes, multiple SmartCard reader is connected. To create a connection on a specific one, slotIndex is used. This Create the SignatureTokenConnection, using the provided path for the library and a way of retrieving the password from the user.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- password- the pin code / password to use
- slotId- the slotId to use
 
- 
Pkcs11SignatureTokenpublic Pkcs11SignatureToken(String pkcs11Path, KeyStore.PasswordProtection password, int slotId, String extraPkcs11Config)Sometimes, multiple SmartCard reader is connected. To create a connection on a specific one, slotIndex is used. This Create the SignatureTokenConnection, using the provided path for the library and a way of retrieving the password from the user.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- password- the pin code / password to use
- slotId- the slotId to use
- extraPkcs11Config- extra configuration for pkcs11 library
 
- 
Pkcs11SignatureTokenSometimes, multiple SmartCard reader is connected. To create a connection on a specific one, slotIndex is used. This create a SignatureTokenConnection and the keys will be accessed using the provided password.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- callback- the callback to enter the pin code / password
- slotId- the slotId to use
 
- 
Pkcs11SignatureTokenpublic Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, int slotId, String extraPkcs11Config)Sometimes, multiple SmartCard reader is connected. To create a connection on a specific one, slotIndex is used. This create a SignatureTokenConnection and the keys will be accessed using the provided password.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- callback- the callback to enter the pin code / password
- slotId- the slotId to use
- extraPkcs11Config- extra configuration for pkcs11 library
 
- 
Pkcs11SignatureTokenpublic Pkcs11SignatureToken(String pkcs11Path, PasswordInputCallback callback, int slotId, int slotListIndex, String extraPkcs11Config)Sometimes, multiple SmartCard reader is connected. To create a connection on a specific one, slotListIndex is used. This create a SignatureTokenConnection and the keys will be accessed using the provided password.- Parameters:
- pkcs11Path- the path for the library (.dll, .so)
- callback- the callback to enter the pin code / password
- slotId- the slotId to use (if negative, the parameter is not used)
- slotListIndex- the slotListIndex to use (if negative, the parameter is not used)
- extraPkcs11Config- extra configuration for pkcs11 library
 
 
- 
- 
Method Details- 
getProvider
- 
buildConfig
- 
escapePath
- 
getPkcs11Path
- 
getSignatureInstanceprotected Signature getSignatureInstance(String javaSignatureAlgorithm) throws NoSuchAlgorithmException- Overrides:
- getSignatureInstancein class- AbstractSignatureTokenConnection
- Throws:
- NoSuchAlgorithmException
 
- 
closepublic void close()
 
-