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 Details

    • AbstractSignatureTokenConnection

      protected AbstractSignatureTokenConnection()
      Default constructor
  • Method Details

    • sign

      public SignatureValue sign(ToBeSigned toBeSigned, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException
      Description copied from interface: SignatureTokenConnection
      This method signs the toBeSigned data with the digest digestAlgorithm and the given keyEntry.
      Specified by:
      sign in interface SignatureTokenConnection
      Parameters:
      toBeSigned - The data that need to be signed
      digestAlgorithm - The digest algorithm to be used before signing
      keyEntry - 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, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm, eu.europa.esig.dss.enumerations.MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException
      Description copied from interface: SignatureTokenConnection
      This method signs the toBeSigned data with the digest digestAlgorithm, the mask mgf and the given keyEntry.
      Specified by:
      sign in interface SignatureTokenConnection
      Parameters:
      toBeSigned - The data that need to be signed
      digestAlgorithm - The digest algorithm to be used before signing
      mgf - the mask generation function
      keyEntry - 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, eu.europa.esig.dss.enumerations.SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException
      Description copied from interface: SignatureTokenConnection
      This method signs the toBeSigned data with the pre-defined signature algorithm signatureAlgorithm, and the given keyEntry.
      Specified by:
      sign in interface SignatureTokenConnection
      Parameters:
      toBeSigned - The data that need to be signed
      signatureAlgorithm - The signature algorithm to be used before signing
      keyEntry - 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, DSSPrivateKeyEntry keyEntry) throws DSSException
      Description copied from interface: SignatureTokenConnection
      This method signs the digest data with the given keyEntry.
      Specified by:
      signDigest in interface SignatureTokenConnection
      Parameters:
      digest - The digested data that need to be signed
      keyEntry - 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, eu.europa.esig.dss.enumerations.MaskGenerationFunction mgf, DSSPrivateKeyEntry keyEntry) throws DSSException
      Description copied from interface: SignatureTokenConnection
      This method signs the digest data with the given keyEntry.
      Specified by:
      signDigest in interface SignatureTokenConnection
      Parameters:
      digest - The digested data that need to be signed
      mgf - the mask generation function
      keyEntry - 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, eu.europa.esig.dss.enumerations.SignatureAlgorithm signatureAlgorithm, DSSPrivateKeyEntry keyEntry) throws DSSException
      Description copied from interface: SignatureTokenConnection
      This method signs the digest data with the pre-defined signatureAlgorithm and the given keyEntry.
      Specified by:
      signDigest in interface SignatureTokenConnection
      Parameters:
      digest - The digested data that need to be signed
      signatureAlgorithm - The signature algorithm
      keyEntry - 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 the java.security.Signature instance for the given javaSignatureAlgorithm
      Parameters:
      javaSignatureAlgorithm - String representing the Java name of a signature algorithm
      Returns:
      Signature
      Throws:
      NoSuchAlgorithmException - if the algorithm is not found
    • createPSSParam

      protected AlgorithmParameterSpec createPSSParam(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgo)
      Creates java.security.spec.AlgorithmParameterSpec for the given digestAlgo
      Parameters:
      digestAlgo - DigestAlgorithm
      Returns:
      AlgorithmParameterSpec