Interface SignatureService
-
- All Known Implementing Classes:
SignatureServiceImpl
public interface SignatureServiceProvides 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
Nested Classes Modifier and Type Interface Description static classSignatureService.SigningDispositionstatic classSignatureService.StatusWithBlobInformation about a blob and its signing status.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<X509Certificate>getCertificates(DocumentModel doc)Returns a list of certificates associated with a given document.SignatureLayoutgetSignatureLayout()SignatureService.StatusWithBlobgetSigningStatus(DocumentModel doc, DocumentModel currentUser)Finds the signing status for the document.BlobsignDocument(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).BlobsignPDF(Blob pdfBlob, DocumentModel doc, DocumentModel user, String userKeyPassword, String reason)Signs a PDF document with a user certificate.
-
-
-
Method Detail
-
getSigningStatus
SignatureService.StatusWithBlob getSigningStatus(DocumentModel doc, DocumentModel currentUser)
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-trueif 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
List<X509Certificate> getCertificates(DocumentModel doc)
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()
-
-