Package eu.europa.esig.dss.token
Class AbstractSignatureTokenConnection
java.lang.Object
eu.europa.esig.dss.token.AbstractSignatureTokenConnection
- All Implemented Interfaces:
SignatureTokenConnection
,AutoCloseable
- Direct Known Subclasses:
AbstractKeyStoreTokenConnection
public abstract class AbstractSignatureTokenConnection
extends Object
implements SignatureTokenConnection
The abstract implementation of a remote token connection
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AlgorithmParameterSpec
createPSSParam
(DigestAlgorithm digestAlgo) Createsjava.security.spec.AlgorithmParameterSpec
for the givendigestAlgo
protected Signature
getSignatureInstance
(String javaSignatureAlgorithm) Returns thejava.security.Signature
instance for the givenjavaSignatureAlgorithm
sign
(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) This method signs thetoBeSigned
data with the digestdigestAlgorithm
, the maskmgf
and the givenkeyEntry
.sign
(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry) This method signs thetoBeSigned
data with the digestdigestAlgorithm
and the givenkeyEntry
.sign
(ToBeSigned toBeSigned, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) This method signs thetoBeSigned
data with the pre-defined signature algorithmsignatureAlgorithm
, and the givenkeyEntry
.signDigest
(Digest digest, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) This method signs thedigest
data with the givenkeyEntry
.signDigest
(Digest digest, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) This method signs thedigest
data with the pre-definedsignatureAlgorithm
and the givenkeyEntry
.signDigest
(Digest digest, DSSPrivateKeyEntry keyEntry) This method signs thedigest
data with the givenkeyEntry
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.europa.esig.dss.token.SignatureTokenConnection
close, getKeys
-
Constructor Details
-
AbstractSignatureTokenConnection
protected AbstractSignatureTokenConnection()Default constructor
-
-
Method Details
-
sign
public SignatureValue sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException Description copied from interface:SignatureTokenConnection
This method signs thetoBeSigned
data with the digestdigestAlgorithm
and the givenkeyEntry
.- Specified by:
sign
in interfaceSignatureTokenConnection
- 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
public SignatureValue sign(ToBeSigned toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException Description copied from interface:SignatureTokenConnection
This method signs thetoBeSigned
data with the digestdigestAlgorithm
, the maskmgf
and the givenkeyEntry
.- Specified by:
sign
in interfaceSignatureTokenConnection
- 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
public SignatureValue sign(ToBeSigned toBeSigned, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException Description copied from interface:SignatureTokenConnection
This method signs thetoBeSigned
data with the pre-defined signature algorithmsignatureAlgorithm
, and the givenkeyEntry
.- Specified by:
sign
in interfaceSignatureTokenConnection
- 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
Description copied from interface:SignatureTokenConnection
This method signs thedigest
data with the givenkeyEntry
.- Specified by:
signDigest
in interfaceSignatureTokenConnection
- 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
public SignatureValue signDigest(Digest digest, MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException Description copied from interface:SignatureTokenConnection
This method signs thedigest
data with the givenkeyEntry
.- Specified by:
signDigest
in interfaceSignatureTokenConnection
- 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
public SignatureValue signDigest(Digest digest, SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException Description copied from interface:SignatureTokenConnection
This method signs thedigest
data with the pre-definedsignatureAlgorithm
and the givenkeyEntry
.- Specified by:
signDigest
in interfaceSignatureTokenConnection
- 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
-
getSignatureInstance
protected Signature getSignatureInstance(String javaSignatureAlgorithm) throws NoSuchAlgorithmException Returns thejava.security.Signature
instance for the givenjavaSignatureAlgorithm
- Parameters:
javaSignatureAlgorithm
-String
representing the Java name of a signature algorithm- Returns:
Signature
- Throws:
NoSuchAlgorithmException
- if the algorithm is not found
-
createPSSParam
Createsjava.security.spec.AlgorithmParameterSpec
for the givendigestAlgo
- Parameters:
digestAlgo
-DigestAlgorithm
- Returns:
AlgorithmParameterSpec
-