Interface SignatureService
- All Known Implementing Classes:
SignatureServiceImpl
public interface SignatureService
Provides digital signature services that can be performed on PDF documents, e.g.:
- signing a specific PDF,
- obtaining a list of certificates already associated with a document.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static class
Information about a blob and its signing status. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of certificates associated with a given document.getSigningStatus
(DocumentModel doc, DocumentModel currentUser) Finds the signing status for the document.signDocument
(DocumentModel doc, DocumentModel user, String userKeyPassword, String reason, boolean pdfa, SignatureService.SigningDisposition disposition, String archiveFilename) Signs a document with a user certificate (converts it into a PDF first if needed).signPDF
(Blob pdfBlob, DocumentModel doc, DocumentModel user, String userKeyPassword, String reason) Signs a PDF document with a user certificate.
-
Method Details
-
getSigningStatus
Finds the signing status for the document.A signature user is determined according to its email.
- Parameters:
doc
- the document- Returns:
- the signing status
-
signDocument
Blob signDocument(DocumentModel doc, DocumentModel user, String userKeyPassword, String reason, boolean pdfa, SignatureService.SigningDisposition disposition, String archiveFilename) Signs a document with a user certificate (converts it into a PDF first if needed).Requires a password to retrieve the certificate from the user keystore.
Does not save the modified document.
- Parameters:
doc
- the document to signuser
- the signing useruserKeyPassword
- the password for the user's signing certificatereason
- the signing reasonpdfa
-true
if the generated PDF should be a PDF/A-1bdisposition
- the signing dispositionarchiveFilename
- the archive filename when using an archive- Returns:
- a blob containing the signed PDF
-
signPDF
Blob signPDF(Blob pdfBlob, DocumentModel doc, DocumentModel user, String userKeyPassword, String reason) throws SignException Signs a PDF document with a user certificate. Requires a password to retrieve the certificate from the user keystore.- Parameters:
doc
- Document model beign signedpdfBlob
- the blob containing the PDF to signuser
- the signing useruserKeyPassword
- the password for the user's signing certificatereason
- the signing reason- Returns:
- a blob containing the signed PDF
- Throws:
SignException
-
getCertificates
Returns a list of certificates associated with a given document.- Parameters:
doc
- the document- Returns:
- the list of certificates (may be empty)
-
getSignatureLayout
SignatureLayout getSignatureLayout()
-