Class RemoteSignatureTokenConnectionImpl
java.lang.Object
eu.europa.esig.dss.ws.server.signing.common.RemoteSignatureTokenConnectionImpl
- All Implemented Interfaces:
RemoteSignatureTokenConnection
public class RemoteSignatureTokenConnectionImpl
extends Object
implements RemoteSignatureTokenConnection
Default implementation of a remote signing service
-
Constructor Summary
ConstructorDescriptionDefault construction instantiating object with null token connection -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a key by its aliasgetKeys()
Retrieves all the available keys (private keys entries) from the token.void
Sets the connection to the KeyStoresign
(ToBeSignedDTO toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, String alias) This method signs thetoBeSigned
data with the digestdigestAlgorithm
, the maskmgf
and the givenalias
.sign
(ToBeSignedDTO toBeSigned, DigestAlgorithm digestAlgorithm, String alias) This method signs thetoBeSigned
data with the digestdigestAlgorithm
and the givenalias
.sign
(ToBeSignedDTO toBeSigned, SignatureAlgorithm signatureAlgorithm, String alias) This method signs thetoBeSigned
data with the digestsignatureAlgorithm
and the givenalias
.signDigest
(DigestDTO digest, MaskGenerationFunction mgf, String alias) This method signs thedigest
data with a maskmgf
and the givenalias
.signDigest
(DigestDTO digest, SignatureAlgorithm signatureAlgorithm, String alias) This method signs thedigest
data with asignatureAlgorithm
and the givenalias
.signDigest
(DigestDTO digest, String alias) This method signs thedigest
data with the givenalias
.
-
Constructor Details
-
RemoteSignatureTokenConnectionImpl
public RemoteSignatureTokenConnectionImpl()Default construction instantiating object with null token connection
-
-
Method Details
-
setToken
Sets the connection to the KeyStore- Parameters:
token
-AbstractKeyStoreTokenConnection
-
getKeys
Description copied from interface:RemoteSignatureTokenConnection
Retrieves all the available keys (private keys entries) from the token.- Specified by:
getKeys
in interfaceRemoteSignatureTokenConnection
- Returns:
- List of encapsulated private keys
- Throws:
DSSException
- If there is any problem during the retrieval process
-
getKey
Description copied from interface:RemoteSignatureTokenConnection
Retrieves a key by its alias- Specified by:
getKey
in interfaceRemoteSignatureTokenConnection
- Parameters:
alias
- the key alias to retrieve- Returns:
- the RemoteKeyEntry with the given alias
- Throws:
DSSException
-
sign
public SignatureValueDTO sign(ToBeSignedDTO toBeSigned, DigestAlgorithm digestAlgorithm, String alias) throws DSSException Description copied from interface:RemoteSignatureTokenConnection
This method signs thetoBeSigned
data with the digestdigestAlgorithm
and the givenalias
.- Specified by:
sign
in interfaceRemoteSignatureTokenConnection
- Parameters:
toBeSigned
- The data that need to be signeddigestAlgorithm
- The digest algorithm to be used before signingalias
- The key alias to be used- Returns:
- The array of bytes representing the signature value
- Throws:
DSSException
- If there is any problem during the signature process
-
sign
public SignatureValueDTO sign(ToBeSignedDTO toBeSigned, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf, String alias) throws DSSException Description copied from interface:RemoteSignatureTokenConnection
This method signs thetoBeSigned
data with the digestdigestAlgorithm
, the maskmgf
and the givenalias
.- Specified by:
sign
in interfaceRemoteSignatureTokenConnection
- Parameters:
toBeSigned
- The data that need to be signeddigestAlgorithm
- The digest algorithm to be used before signingmgf
- the mask generation functionalias
- The key alias to be used- Returns:
- The array of bytes representing the signature value
- Throws:
DSSException
- If there is any problem during the signature process
-
sign
public SignatureValueDTO sign(ToBeSignedDTO toBeSigned, SignatureAlgorithm signatureAlgorithm, String alias) throws DSSException Description copied from interface:RemoteSignatureTokenConnection
This method signs thetoBeSigned
data with the digestsignatureAlgorithm
and the givenalias
.- Specified by:
sign
in interfaceRemoteSignatureTokenConnection
- Parameters:
toBeSigned
- The data that need to be signedsignatureAlgorithm
- The signature algorithm to be used for signingalias
- The key alias to be used- Returns:
- The array of bytes representing the signature value
- Throws:
DSSException
- If there is any problem during the signature process
-
signDigest
Description copied from interface:RemoteSignatureTokenConnection
This method signs thedigest
data with the givenalias
.- Specified by:
signDigest
in interfaceRemoteSignatureTokenConnection
- Parameters:
digest
- The digested data that need to be signedalias
- The key alias 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 SignatureValueDTO signDigest(DigestDTO digest, MaskGenerationFunction mgf, String alias) throws DSSException Description copied from interface:RemoteSignatureTokenConnection
This method signs thedigest
data with a maskmgf
and the givenalias
.- Specified by:
signDigest
in interfaceRemoteSignatureTokenConnection
- Parameters:
digest
- The digested data that need to be signedmgf
- the mask generation functionalias
- The key alias 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 SignatureValueDTO signDigest(DigestDTO digest, SignatureAlgorithm signatureAlgorithm, String alias) throws DSSException Description copied from interface:RemoteSignatureTokenConnection
This method signs thedigest
data with asignatureAlgorithm
and the givenalias
.- Specified by:
signDigest
in interfaceRemoteSignatureTokenConnection
- Parameters:
digest
- The digested data that need to be signedsignatureAlgorithm
- The signature algorithm to be used for signingalias
- The key alias 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
-