Class PAdESService

    • Constructor Detail

      • PAdESService

        public PAdESService​(CertificateVerifier certificateVerifier)
        This is the constructor to create an instance of the PAdESService. A certificate verifier must be provided.
        Parameters:
        certificateVerifier - CertificateVerifier provides information on the sources to be used in the validation process in the context of a signature.
    • Method Detail

      • getContentTimestamp

        public TimestampToken getContentTimestamp​(DSSDocument toSignDocument,
                                                  PAdESSignatureParameters parameters)
        Description copied from interface: DocumentSignatureService
        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:
      • getDataToSign

        public ToBeSigned getDataToSign​(DSSDocument toSignDocument,
                                        PAdESSignatureParameters parameters)
                                 throws DSSException
        Description copied from interface: DocumentSignatureService
        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

        public DSSDocument signDocument​(DSSDocument toSignDocument,
                                        PAdESSignatureParameters parameters,
                                        SignatureValue signatureValue)
                                 throws DSSException
        Description copied from interface: DocumentSignatureService
        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
      • getAvailableSignatureFields

        public List<String> getAvailableSignatureFields​(DSSDocument document)
        This method returns not signed signature-fields
        Parameters:
        document - the pdf document
        Returns:
        the list of empty signature fields
      • addNewSignatureField

        public DSSDocument addNewSignatureField​(DSSDocument document,
                                                SignatureFieldParameters parameters)
        This method allows to add a new signature field to an existing pdf document
        Parameters:
        document - the pdf document
        parameters - the parameters with the coordinates,... of the signature field
        Returns:
        the pdf document with the new added signature field