Package eu.europa.esig.dss.pdf
Interface PDFSignatureService
- All Known Implementing Classes:
AbstractPDFSignatureService
,ITextPDFSignatureService
,PdfBoxSignatureService
public interface PDFSignatureService
The 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 DSSDocument
addDssDictionary(DSSDocument document, List<DSSDictionaryCallback> callbacks)
This method adds the DSS dictionary (Baseline-LT)DSSDocument
addDssDictionary(DSSDocument document, List<DSSDictionaryCallback> callbacks, String pwd)
This method adds the DSS dictionary (Baseline-LT)DSSDocument
addNewSignatureField(DSSDocument document, SignatureFieldParameters parameters)
This method allows to add a new signature field to an existing pdf documentDSSDocument
addNewSignatureField(DSSDocument document, SignatureFieldParameters parameters, String pwd)
This method allows to add a new signature field to an existing encrypted pdf documentbyte[]
digest(DSSDocument toSignDocument, PAdESCommonParameters parameters)
Returns the digest value of a PDF documentList<String>
getAvailableSignatureFields(DSSDocument document)
This method returns not signed signature-fieldsList<String>
getAvailableSignatureFields(DSSDocument document, String pwd)
Returns not-signed signature fields from an encrypted documentList<PdfRevision>
getRevisions(DSSDocument document, String pwd)
Retrieves revisions from a PDF documentDSSDocument
sign(DSSDocument pdfData, byte[] signatureValue, PAdESCommonParameters parameters)
Signs a PDF document
-
Method Details
-
digest
Returns the digest value of a PDF document- Parameters:
toSignDocument
- the document to be signedparameters
- the signature/timestamp parameters- Returns:
- the digest value
- Throws:
DSSException
- if an error occurred
-
sign
Signs a PDF document- Parameters:
pdfData
- the pdf documentsignatureValue
- the signature valueparameters
- the signature/timestamp parameters- Throws:
DSSException
- if an error occurred
-
getRevisions
Retrieves revisions from a PDF document- Parameters:
document
- the document to extract revisions frompwd
- the password protection phrase used to encrypt the PDF document use 'null' value for not an encrypted document- Returns:
- list of extracted
PdfRevision
s
-
addDssDictionary
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
-
addDssDictionary
DSSDocument addDssDictionary(DSSDocument document, List<DSSDictionaryCallback> callbacks, String pwd)This method adds the DSS dictionary (Baseline-LT)- Parameters:
document
- the document to be extendedcallbacks
- the callbacks to retrieve the revocation data,...pwd
- the password protection used to create the encrypted document- Returns:
- the pdf document with the added dss dictionary
- Throws:
DSSException
- if an error occurred
-
getAvailableSignatureFields
This method returns not signed signature-fields- Parameters:
document
- the pdf document- Returns:
- the list of empty signature fields
-
getAvailableSignatureFields
Returns not-signed signature fields from an encrypted document- Parameters:
document
- the pdf documentpwd
- the password protection phrase used to encrypt the document- Returns:
- the list of not signed signature field names
-
addNewSignatureField
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
DSSDocument addNewSignatureField(DSSDocument document, SignatureFieldParameters parameters, String pwd)This method allows to add a new signature field to an existing encrypted pdf document- Parameters:
document
- the pdf documentparameters
- the parameters with the coordinates,... of the signature fieldpwd
- the password protection used to create the encrypted document- Returns:
- the pdf document with the new added signature field
-