java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
eu.europa.esig.dss.pades.signature.PAdESService
- All Implemented Interfaces:
eu.europa.esig.dss.signature.DocumentSignatureService<PAdESSignatureParameters,,PAdESTimestampParameters> Serializable
public class PAdESService
extends eu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
PAdES implementation of the DocumentSignatureService
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
certificateVerifier, tspSource -
Constructor Summary
ConstructorsConstructorDescriptionPAdESService(eu.europa.esig.dss.validation.CertificateVerifier certificateVerifier) This is the constructor to create an instance of thePAdESService. -
Method Summary
Modifier and TypeMethodDescriptioneu.europa.esig.dss.model.DSSDocumentaddNewSignatureField(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters) This method allows to add a new signature field to an existing pdf documenteu.europa.esig.dss.model.DSSDocumentaddNewSignatureField(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters, char[] passwordProtection) This method allows to add a new signature field to an encrypted pdf documentprotected eu.europa.esig.dss.model.DSSMessageDigestcomputeDocumentDigest(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) Computes digest of the document to be signedeu.europa.esig.dss.model.DSSDocumentextendDocument(eu.europa.esig.dss.model.DSSDocument toExtendDocument, PAdESSignatureParameters parameters) protected byte[]generateCMSSignedData(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue) Generates the CMSSignedDatagetAvailableSignatureFields(eu.europa.esig.dss.model.DSSDocument document) This method returns not signed signature-fieldsgetAvailableSignatureFields(eu.europa.esig.dss.model.DSSDocument document, char[] passwordProtection) This method returns not signed signature-fields from an encrypted documenteu.europa.esig.dss.spi.x509.tsp.TimestampTokengetContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) protected PDFSignatureServiceThis method is used to return a newPDFSignatureServicefor a content timestamp creationeu.europa.esig.dss.model.ToBeSignedgetDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) protected PDFSignatureServiceThis method is used to return a newPDFSignatureServicefor a signature creationprotected PDFSignatureServiceThis method is used to return a newPDFSignatureServicefor a timestamp creationeu.europa.esig.dss.model.DSSDocumentpreviewPageWithVisualSignature(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) Returns a page preview with the visual signatureeu.europa.esig.dss.model.DSSDocumentpreviewSignatureField(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) Returns a preview of the signature fieldvoidsetPdfObjFactory(IPdfObjFactory pdfObjFactory) Set the IPdfObjFactory.voidsetTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource) eu.europa.esig.dss.model.DSSDocumentsignDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue) eu.europa.esig.dss.model.DSSDocumenttimestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, PAdESTimestampParameters parameters) Methods inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
assertSigningCertificateValid, ensureSignatureValue, getFinalDocumentName, getFinalDocumentName, getFinalFileName, getFinalFileName, getFinalFileName, isValidSignatureValue
-
Constructor Details
-
PAdESService
public PAdESService(eu.europa.esig.dss.validation.CertificateVerifier certificateVerifier) This is the constructor to create an instance of thePAdESService. A certificate verifier must be provided.- Parameters:
certificateVerifier-CertificateVerifierprovides information on the sources to be used in the validation process in the context of a signature.
-
-
Method Details
-
setPdfObjFactory
Set the IPdfObjFactory. Allow to set the used implementation. Cannot be null.- Parameters:
pdfObjFactory- the implementation to be used.
-
setTspSource
public void setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource) - Specified by:
setTspSourcein interfaceeu.europa.esig.dss.signature.DocumentSignatureService<PAdESSignatureParameters,PAdESTimestampParameters> - Overrides:
setTspSourcein classeu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
-
getContentTimestamp
public eu.europa.esig.dss.spi.x509.tsp.TimestampToken getContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) -
previewPageWithVisualSignature
public eu.europa.esig.dss.model.DSSDocument previewPageWithVisualSignature(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) Returns a page preview with the visual signature- Parameters:
toSignDocument- the document to be signedparameters- the signature/timestamp parameters- Returns:
- a DSSDocument with the PNG picture
-
previewSignatureField
public eu.europa.esig.dss.model.DSSDocument previewSignatureField(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) Returns a preview of the signature field- Parameters:
toSignDocument- the document to be signedparameters- the signature/timestamp parameters- Returns:
- a DSSDocument with the PNG picture
-
getDataToSign
public eu.europa.esig.dss.model.ToBeSigned getDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) throws eu.europa.esig.dss.model.DSSException - Throws:
eu.europa.esig.dss.model.DSSException
-
computeDocumentDigest
protected eu.europa.esig.dss.model.DSSMessageDigest computeDocumentDigest(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters) Computes digest of the document to be signed- Parameters:
toSignDocument-DSSDocumentthe to be signed PDFparameters-PAdESSignatureParameters- Returns:
DSSMessageDigest
-
signDocument
public eu.europa.esig.dss.model.DSSDocument signDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue) -
generateCMSSignedData
protected byte[] generateCMSSignedData(eu.europa.esig.dss.model.DSSDocument toSignDocument, PAdESSignatureParameters parameters, eu.europa.esig.dss.model.SignatureValue signatureValue) Generates the CMSSignedData- Parameters:
toSignDocument-DSSDocumentto be signedparameters-PAdESSignatureParameterssignatureValue-SignatureValue- Returns:
- byte array representing the CMSSignedData
-
extendDocument
public eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.model.DSSDocument toExtendDocument, PAdESSignatureParameters parameters) throws eu.europa.esig.dss.model.DSSException - Throws:
eu.europa.esig.dss.model.DSSException
-
getAvailableSignatureFields
This method returns not signed signature-fields- Parameters:
document- the pdf document- Returns:
- the list of empty signature fields
-
getAvailableSignatureFields
public List<String> getAvailableSignatureFields(eu.europa.esig.dss.model.DSSDocument document, char[] passwordProtection) This method returns not signed signature-fields from an encrypted document- Parameters:
document- the pdf documentpasswordProtection- the password protection used to create the encrypted document- Returns:
- the list of empty signature fields
-
addNewSignatureField
public eu.europa.esig.dss.model.DSSDocument addNewSignatureField(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters) This method allows to add a new signature field to an existing pdf document- Parameters:
document- the pdf documentparameters- the parameters with the coordinates,... of the signature field- Returns:
- the pdf document with the new added signature field
-
addNewSignatureField
public eu.europa.esig.dss.model.DSSDocument addNewSignatureField(eu.europa.esig.dss.model.DSSDocument document, SignatureFieldParameters parameters, char[] passwordProtection) This method allows to add a new signature field to an encrypted pdf document- Parameters:
document- the pdf documentparameters- the parameters with the coordinates,... of the signature fieldpasswordProtection- the password protection used to create the encrypted document- Returns:
- the pdf document with the new added signature field
-
timestamp
public eu.europa.esig.dss.model.DSSDocument timestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, PAdESTimestampParameters parameters) - Specified by:
timestampin interfaceeu.europa.esig.dss.signature.DocumentSignatureService<PAdESSignatureParameters,PAdESTimestampParameters> - Overrides:
timestampin classeu.europa.esig.dss.signature.AbstractSignatureService<PAdESSignatureParameters,PAdESTimestampParameters>
-
getPAdESSignatureService
This method is used to return a newPDFSignatureServicefor a signature creation- Returns:
PDFSignatureService
-
getContentTimestampService
This method is used to return a newPDFSignatureServicefor a content timestamp creation- Returns:
PDFSignatureService
-
getSignatureTimestampService
This method is used to return a newPDFSignatureServicefor a timestamp creation- Returns:
PDFSignatureService
-