public class PKCS11SignatureToken extends Object implements SignatureToken
Constructor and Description |
---|
PKCS11SignatureToken(String pkcs11ModulePath,
char[] password,
int slotIndex)
Initializes the PKCS#11 token.
|
PKCS11SignatureToken(String pkcs11ModulePath,
char[] password,
int slotIndex,
String label)
Initializes the PKCS#11 token.
|
PKCS11SignatureToken(String pkcs11ModulePath,
eu.europa.esig.dss.token.PasswordInputCallback passwordCallback,
int slotIndex)
Initializes the PKCS#11 token with password callback.
|
PKCS11SignatureToken(String pkcs11ModulePath,
eu.europa.esig.dss.token.PasswordInputCallback passwordCallback,
int slotIndex,
String label)
Initializes the PKCS#11 token with password callback.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
X509Certificate |
getCertificate()
Returns signer certificate
|
List<eu.europa.esig.dss.token.DSSPrivateKeyEntry> |
getPrivateKeyEntries()
Fetches the private key entries from the hardware token for information purposes.
|
byte[] |
sign(DigestAlgorithm digestAlgorithm,
byte[] dataToSign)
There must be implemented routines needed for signing
|
void |
usePrivateKeyEntry(eu.europa.esig.dss.token.DSSPrivateKeyEntry keyEntry)
For selecting a particular private key to be used for signing.
|
public PKCS11SignatureToken(String pkcs11ModulePath, char[] password, int slotIndex)
pkcs11ModulePath
- PKCS#11 module path, depends on your operating system and installed smart card or hardware token library.password
- Secret pin code for digital signature.slotIndex
- Token slot index, depends on the hardware token.public PKCS11SignatureToken(String pkcs11ModulePath, eu.europa.esig.dss.token.PasswordInputCallback passwordCallback, int slotIndex)
pkcs11ModulePath
- PKCS#11 module path, depends on your operating system and installed smart card or hardware token library.passwordCallback
- callback for providing the password for the private key.slotIndex
- Token slot index, depends on the hardware token.public PKCS11SignatureToken(String pkcs11ModulePath, char[] password, int slotIndex, String label)
pkcs11ModulePath
- PKCS#11 module path, depends on your operating system and installed smart card or hardware token library.password
- Secret pin code for digital signature.slotIndex
- Token slot index, depends on the hardware token.label
- Label of the keypair in HSM.public PKCS11SignatureToken(String pkcs11ModulePath, eu.europa.esig.dss.token.PasswordInputCallback passwordCallback, int slotIndex, String label)
pkcs11ModulePath
- PKCS#11 module path, depends on your operating system and installed smart card or hardware
token library.passwordCallback
- callback for providing the password for the private key.slotIndex
- Token slot index, depends on the hardware token.label
- Label of the keypair in HSM.public List<eu.europa.esig.dss.token.DSSPrivateKeyEntry> getPrivateKeyEntries()
public void usePrivateKeyEntry(eu.europa.esig.dss.token.DSSPrivateKeyEntry keyEntry)
keyEntry
- Private key entry to setpublic X509Certificate getCertificate()
SignatureToken
getCertificate
in interface SignatureToken
public byte[] sign(DigestAlgorithm digestAlgorithm, byte[] dataToSign)
SignatureToken
sign
in interface SignatureToken
digestAlgorithm
- provides needed information for signingdataToSign
- data to signpublic void close()
close
in interface SignatureToken
Copyright © 2023. All rights reserved.