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 void
close()
List<DSSPrivateKeyEntry>
getKeys()
Retrieves all the available keys (private keys entries) from the token.SignatureValue
sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry)
This method signs thetoBeSigned
data with the digestdigestAlgorithm
, the maskmgf
and the givenkeyEntry
.SignatureValue
sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry)
This method signs thetoBeSigned
data with the digestdigestAlgorithm
and the givenkeyEntry
.SignatureValue
signDigest(Digest digest, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry)
This method signs thedigest
data with the givenkeyEntry
.SignatureValue
signDigest(Digest digest, DSSPrivateKeyEntry keyEntry)
This method signs thedigest
data with the givenkeyEntry
.
-
Method Details
-
close
void close()- Specified by:
close
in 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 DSSExceptionThis method signs thetoBeSigned
data with the digestdigestAlgorithm
and 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, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSExceptionThis method signs thetoBeSigned
data with the digestdigestAlgorithm
, the maskmgf
and 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 thedigest
data 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, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSExceptionThis method signs thedigest
data 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
-