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, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry)This method signs thetoBeSigneddata with the digestdigestAlgorithm, the maskmgfand the givenkeyEntry.SignatureValuesign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry)This method signs thetoBeSigneddata with the digestdigestAlgorithmand the givenkeyEntry.SignatureValuesignDigest(Digest digest, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry)This method signs thedigestdata with the givenkeyEntry.SignatureValuesignDigest(Digest digest, DSSPrivateKeyEntry keyEntry)This method signs thedigestdata with the givenkeyEntry.
-
-
-
Method Detail
-
close
void close()
- Specified by:
closein interfaceAutoCloseable
-
getKeys
List<DSSPrivateKeyEntry> getKeys() throws DSSException
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
SignatureValue sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException
This 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
SignatureValue signDigest(Digest digest, DSSPrivateKeyEntry keyEntry) throws DSSException
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, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException
This 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
-
-