Package eu.europa.esig.dss.pdf
Interface PDFSignatureService
-
- All Known Implementing Classes:
AbstractPDFSignatureService,ITextPDFSignatureService,PdfBoxSignatureService
public interface PDFSignatureServiceThe usage of this interface permits the user to choose the underlying PDF library used to create PDF signatures.
-
-
Method Summary
Modifier and Type Method Description DSSDocumentaddDssDictionary(DSSDocument document, List<DSSDictionaryCallback> callbacks)This method adds the DSS dictionary (Baseline-LT)DSSDocumentaddNewSignatureField(DSSDocument document, SignatureFieldParameters parameters)This method allows to add a new signature field to an existing pdf documentbyte[]digest(DSSDocument toSignDocument, PAdESSignatureParameters parameters, DigestAlgorithm digestAlgorithm)Returns the digest value of a PDF documentList<String>getAvailableSignatureFields(DSSDocument document)This method returns not signed signature-fieldsDSSDocumentsign(DSSDocument pdfData, byte[] signatureValue, PAdESSignatureParameters parameters, DigestAlgorithm digestAlgorithm)Signs a PDF documentvoidvalidateSignatures(CertificatePool validationCertPool, DSSDocument document, SignatureValidationCallback callback)Retrieves and triggers validation of the signatures from a PDF document
-
-
-
Method Detail
-
digest
byte[] digest(DSSDocument toSignDocument, PAdESSignatureParameters parameters, DigestAlgorithm digestAlgorithm)
Returns the digest value of a PDF document- Parameters:
toSignDocument- the document to be signedparameters- the signature parametersdigestAlgorithm- the digest algorithm to be used- Returns:
- the digest value
- Throws:
DSSException- if an error occurred
-
sign
DSSDocument sign(DSSDocument pdfData, byte[] signatureValue, PAdESSignatureParameters parameters, DigestAlgorithm digestAlgorithm)
Signs a PDF document- Parameters:
pdfData- the pdf documentsignatureValue- the signature valueparameters- the signature parametersdigestAlgorithm- the digest algorithm to be used- Throws:
DSSException- if an error occurred
-
validateSignatures
void validateSignatures(CertificatePool validationCertPool, DSSDocument document, SignatureValidationCallback callback)
Retrieves and triggers validation of the signatures from a PDF document- Parameters:
validationCertPool- the certificate pooldocument- the document to be validatedcallback- callback for signature validation- Throws:
DSSException- if an error occurred
-
addDssDictionary
DSSDocument addDssDictionary(DSSDocument document, List<DSSDictionaryCallback> callbacks)
This method adds the DSS dictionary (Baseline-LT)- Parameters:
document- the document to be extendedcallbacks- the callbacks to retrieve the revocation data,...- Returns:
- the pdf document with the added dss dictionary
- Throws:
DSSException- if an error occurred
-
getAvailableSignatureFields
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
DSSDocument addNewSignatureField(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
-
-