Package eu.europa.esig.dss.token
Interface SignatureTokenConnection
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractKeyStoreTokenConnection,AbstractSignatureTokenConnection,JKSSignatureToken,KeyStoreSignatureTokenConnection,MSCAPISignatureToken,Pkcs11SignatureToken,Pkcs12SignatureToken
public interface SignatureTokenConnection extends AutoCloseable
Connection through available API to the QSCD (SmartCard, MSCAPI, PKCS#12)
-
Method Summary
Modifier and Type Method Description voidclose()List<DSSPrivateKeyEntry>getKeys()Retrieves all the available keys (private keys entries) from the token.SignatureValuesign(ToBeSigned toBeSigned, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm, eu.europa.esig.dss.enumerations.MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry)This method signs thetoBeSigneddata with the digestdigestAlgorithm, the maskmgfand the givenkeyEntry.SignatureValuesign(ToBeSigned toBeSigned, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry)This method signs thetoBeSigneddata with the digestdigestAlgorithmand the givenkeyEntry.SignatureValuesignDigest(Digest digest, eu.europa.esig.dss.enumerations.MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry)This method signs thedigestdata with the givenkeyEntry.SignatureValuesignDigest(Digest digest, DSSPrivateKeyEntry keyEntry)This method signs thedigestdata with the givenkeyEntry.
-
Method Details
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
getKeys
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
-
sign
SignatureValue sign(ToBeSigned toBeSigned, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSExceptionThis method signs thetoBeSigneddata with the digestdigestAlgorithmand the givenkeyEntry.- Parameters:
toBeSigned- The data that need to be signeddigestAlgorithm- The digest algorithm to be used before signingkeyEntry- The private key to be used- Returns:
- the signature value representation with the used algorithm and the binary value
- Throws:
DSSException- If there is any problem during the signature process
-
sign
SignatureValue sign(ToBeSigned toBeSigned, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm, eu.europa.esig.dss.enumerations.MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSExceptionThis method signs thetoBeSigneddata with the digestdigestAlgorithm, the maskmgfand the givenkeyEntry.- Parameters:
toBeSigned- The data that need to be signeddigestAlgorithm- The digest algorithm to be used before signingmgf- the mask generation functionkeyEntry- The private key to be used- Returns:
- the signature value representation with the used algorithm and the binary value
- Throws:
DSSException- If there is any problem during the signature process
-
signDigest
This method signs thedigestdata with the givenkeyEntry.- Parameters:
digest- The digested data that need to be signedkeyEntry- The private key to be used- Returns:
- the signature value representation with the used algorithm and the binary value
- Throws:
DSSException- If there is any problem during the signature process
-
signDigest
SignatureValue signDigest(Digest digest, eu.europa.esig.dss.enumerations.MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSExceptionThis method signs thedigestdata with the givenkeyEntry.- Parameters:
digest- The digested data that need to be signedmgf- the mask generation functionkeyEntry- The private key to be used- Returns:
- the signature value representation with the used algorithm and the binary value
- Throws:
DSSException- If there is any problem during the signature process
-