Interface DocumentSignatureService<SP extends AbstractSerializableSignatureParameters>

    • Method Detail

      • getDataToSign

        ToBeSigned getDataToSign​(DSSDocument toSignDocument,
                                 SP parameters)
                          throws DSSException
        Retrieves the bytes of the data that need to be signed based on the toSignDocument and parameters . When toSignDocument contains an already existing signature the returned bytes are related to a new parallel signature. - Enveloped signature (XML): a new signature is added and the signed data corresponds to that pointed by the first signature; - Enveloping signature: - - XML: The parallel signature is not possible - - CMS: A new parallel signature is added - Detached signature: - - XML: The parallel signature is added - - CMS: A new parallel signature is added
        Parameters:
        toSignDocument - document to sign or the already existing signature
        parameters - set of the driving signing parameters
        Returns:
        the data to be signed
        Throws:
        DSSException - if an error occurred
      • signDocument

        DSSDocument signDocument​(DSSDocument toSignDocument,
                                 SP parameters,
                                 SignatureValue signatureValue)
                          throws DSSException
        Signs the toSignDocument with the provided signatureValue.
        Parameters:
        toSignDocument - document to sign
        parameters - set of the driving signing parameters
        signatureValue - the signature value to incorporate
        Returns:
        the signed document (toSignDocument with the incorporated signature or the detached signature)
        Throws:
        DSSException - if an error occurred
      • extendDocument

        DSSDocument extendDocument​(DSSDocument toExtendDocument,
                                   SP parameters)
                            throws DSSException
        Extends the level of the signatures in the toExtendDocument
        Parameters:
        toExtendDocument - document to extend
        parameters - set of the driving signing parameters
        Returns:
        the extended signature
        Throws:
        DSSException - if an error occurred
      • setTspSource

        void setTspSource​(TSPSource tspSource)
        This setter allows to define the TSP (timestamp provider) source.
        Parameters:
        tspSource - The time stamp source which is used when timestamping the signature.
      • getContentTimestamp

        TimestampToken getContentTimestamp​(DSSDocument toSignDocument,
                                           SP parameters)
        This method allows to compute a content-timestamp (which is added in the signed properties)
        Parameters:
        toSignDocument - document to sign or the already existing signature
        parameters - set of the driving signing parameters
        Returns: