Package com.pd4ml.pdf.sign.pdf
Class IncrementalPdfSigner
- java.lang.Object
-
- com.pd4ml.pdf.sign.pdf.IncrementalPdfSigner
-
public final class IncrementalPdfSigner extends java.lang.ObjectApplies a PDF digital signature as a raw incremental update, on top ofIncrementalUpdateWriter(the generic COS incremental-update mechanics -- object offsets, xref, trailer) fromcom.pd4ml.pdf.cos.writer. Everything in this class is specific to digital signatures: building the/Sigdictionary, the signature field widget, wiring it into the AcroForm and the target page, the optional visible appearance, DocMDP certification, and the/Contents//ByteRangeplaceholder dance a PDF signature's byte-range hash requires.Not supported: encrypted input PDFs.
com.pd4ml.pdf.cosis a reader (its own docs: "this package is a reader, not a PDF writer/optimizer"), so it can decrypt while parsing but can't re-encrypt on write; appending plaintext new objects into an otherwise-encrypted incremental update would be worse than refusing outright.
-
-
Constructor Summary
Constructors Constructor Description IncrementalPdfSigner(byte[] originalPdfBytes, SigningOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description COSDocumentgetDocument()The parsed input document, e.g.SignResultsign(ByteRangeSigner signer)Performs the whole incremental-update signing flow, callingsignerexactly once, with exactly the bytes the resulting PDF signature is defined to cover.
-
-
-
Constructor Detail
-
IncrementalPdfSigner
public IncrementalPdfSigner(byte[] originalPdfBytes, SigningOptions options) throws PdfSigningException- Throws:
PdfSigningException
-
-
Method Detail
-
getDocument
public COSDocument getDocument()
The parsed input document, e.g. for a caller that wants to inspect it (page count, existing signatures, ...) before signing.
-
sign
public SignResult sign(ByteRangeSigner signer) throws PdfSigningException
Performs the whole incremental-update signing flow, callingsignerexactly once, with exactly the bytes the resulting PDF signature is defined to cover.- Throws:
PdfSigningException
-
-