Package eu.europa.esig.dss.token
Interface SignatureTokenConnection
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractKeyStoreTokenConnection,AbstractSignatureTokenConnection,AppleSignatureToken,JKSSignatureToken,KeyStoreSignatureTokenConnection,MSCAPISignatureToken,Pkcs11SignatureToken,Pkcs12SignatureToken
Connection through available API to the QSCD (SmartCard, MSCAPI, PKCS#12)
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getKeys()Retrieves all the available keys (private keys entries) from the token.sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) Deprecated.since DSS 6.1.sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry) This method signs thetoBeSigneddata with the digestdigestAlgorithmand the givenkeyEntry.sign(ToBeSigned toBeSigned, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) This method signs thetoBeSigneddata with the pre-defined signature algorithmsignatureAlgorithm, and the givenkeyEntry.signDigest(Digest digest, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) Deprecated.since DSS 6.1.signDigest(Digest digest, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) This method signs thedigestdata with the pre-definedsignatureAlgorithmand the givenkeyEntry.signDigest(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, DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException This 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
@Deprecated SignatureValue sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException Deprecated.since DSS 6.1. Please use#sign(toBeSigned, signatureAlgorithm, keyEntry)in order to specify an algorithm with a used MGFThis 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
-
sign
SignatureValue sign(ToBeSigned toBeSigned, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException This method signs thetoBeSigneddata with the pre-defined signature algorithmsignatureAlgorithm, and the givenkeyEntry.- Parameters:
toBeSigned- The data that need to be signedsignatureAlgorithm- The signature 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
-
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
@Deprecated SignatureValue signDigest(Digest digest, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException Deprecated.since DSS 6.1. Please usesignDigest(digest, signatureAlgorithm, keyEntry)method in order to specify an algorithm with an expected mask generation functionThis 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
-
signDigest
SignatureValue signDigest(Digest digest, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException This method signs thedigestdata with the pre-definedsignatureAlgorithmand the givenkeyEntry.- Parameters:
digest- The digested data that need to be signedsignatureAlgorithm- The signature algorithmkeyEntry- 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
-