iText 8.0.3 API
iText.Signatures.PdfTwoPhaseSigner Class Reference

Public Member Functions

  PdfTwoPhaseSigner (PdfReader reader, Stream outputStream)
 
virtual byte[]  PrepareDocumentForSignature (SignerProperties signerProperties, String digestAlgorithm, PdfName filter, PdfName subFilter, int estimatedSize, bool includeDate)
  Prepares document for signing, calculates the document digest to sign and closes the document. More...
 
virtual iText.Signatures.PdfTwoPhaseSigner  SetStampingProperties (StampingProperties stampingProperties)
  Set stamping properties to be used during main signing operation. More...
 

Static Public Member Functions

static void  AddSignatureToPreparedDocument (PdfDocument document, String fieldName, Stream outs, CMSContainer cmsContainer)
  Adds an existing signature to a PDF where space was already reserved. More...
 
static void  AddSignatureToPreparedDocument (PdfDocument document, String fieldName, Stream outs, byte[] signedContent)
  Adds an existing signature to a PDF where space was already reserved. More...
 

Member Function Documentation

◆ AddSignatureToPreparedDocument() [1/2]

static void iText.Signatures.PdfTwoPhaseSigner.AddSignatureToPreparedDocument ( PdfDocument  document,
String  fieldName,
Stream  outs,
byte[]  signedContent 
)
inlinestatic

Adds an existing signature to a PDF where space was already reserved.

Parameters
document the original PDF
fieldName the field to sign. It must be the last field
outs the output PDF
signedContent the bytes for the signed data

◆ AddSignatureToPreparedDocument() [2/2]

static void iText.Signatures.PdfTwoPhaseSigner.AddSignatureToPreparedDocument ( PdfDocument  document,
String  fieldName,
Stream  outs,
CMSContainer  cmsContainer 
)
inlinestatic

Adds an existing signature to a PDF where space was already reserved.

Parameters
document the original PDF
fieldName the field to sign. It must be the last field
outs the output PDF
cmsContainer the finalized CMS container

◆ PrepareDocumentForSignature()

virtual byte [] iText.Signatures.PdfTwoPhaseSigner.PrepareDocumentForSignature ( SignerProperties  signerProperties,
String  digestAlgorithm,
PdfName  filter,
PdfName  subFilter,
int  estimatedSize,
bool  includeDate 
)
inlinevirtual

Prepares document for signing, calculates the document digest to sign and closes the document.

Parameters
signerProperties

SignerProperties properties to be used for main signing operation

Parameters
digestAlgorithm the algorithm to generate the digest with
filter PdfName of the signature handler to use when validating this signature
subFilter PdfName that describes the encoding of the signature
estimatedSize the estimated size of the signature, this is the size of the space reserved for the Cryptographic Message Container
includeDate specifies if the signing date should be set to the signature dictionary
Returns
the message digest of the prepared document.

◆ SetStampingProperties()

virtual iText.Signatures.PdfTwoPhaseSigner iText.Signatures.PdfTwoPhaseSigner.SetStampingProperties ( StampingProperties  stampingProperties )
inlinevirtual

Set stamping properties to be used during main signing operation.

Set stamping properties to be used during main signing operation.

If none is set, stamping properties with append mode enabled will be used

Parameters
stampingProperties

iText.Kernel.Pdf.StampingProperties instance to be used during main signing operation

Returns
same instance of PdfTwoPhaseSigner