iText 8.0.4 API
iText.Signatures.PadesTwoPhaseSigningHelper Class Reference

Helper class to perform signing operation in two steps. More...

Public Member Functions

  PadesTwoPhaseSigningHelper ()
  Create instance of PadesTwoPhaseSigningHelper. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetOcspClient (IOcspClient ocspClient)
  Set IOcspClient to be used for LTV Verification. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetTrustedCertificates (IList< IX509Certificate > certificateList)
  Set certificate list to be used by the IIssuingCertificateRetriever to retrieve missing certificates. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetCrlClient (ICrlClient crlClient)
  Set ICrlClient to be used for LTV Verification. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetTSAClient (ITSAClient tsaClient)
  Set ITSAClient to be used for timestamp signature creation. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetIssuingCertificateRetriever (IIssuingCertificateRetriever issuingCertificateRetriever)
  Set IIssuingCertificateRetriever to be used before main signing operation. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetEstimatedSize (int estimatedSize)
  Set estimated size of a signature to be applied. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetTemporaryDirectoryPath (String temporaryDirectoryPath)
  Set temporary directory to be used for temporary files creation. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetTimestampSignatureName (String timestampSignatureName)
  Set the name to be used for timestamp signature creation. More...
 
virtual iText.Signatures.PadesTwoPhaseSigningHelper  SetStampingProperties (StampingProperties stampingProperties)
  Set stamping properties to be used during main signing operation. More...
 
virtual CMSContainer  CreateCMSContainerWithoutSignature (IX509Certificate[] certificates, String digestAlgorithm, PdfReader inputDocument, Stream outputStream, SignerProperties signerProperties)
  Creates CMS container compliant with PAdES level. More...
 
virtual void  SignCMSContainerWithBaselineBProfile (IExternalSignature externalSignature, PdfReader inputDocument, Stream outputStream, String signatureFieldName, CMSContainer cmsContainer)
  Follow-up step that signs prepared document with PAdES Baseline-B profile. More...
 
virtual void  SignCMSContainerWithBaselineTProfile (IExternalSignature externalSignature, PdfReader inputDocument, Stream outputStream, String signatureFieldName, CMSContainer cmsContainer)
  Follow-up step that signs prepared document with PAdES Baseline-T profile. More...
 
virtual void  SignCMSContainerWithBaselineLTProfile (IExternalSignature externalSignature, PdfReader inputDocument, Stream outputStream, String signatureFieldName, CMSContainer cmsContainer)
  Follow-up step that signs prepared document with PAdES Baseline-LT profile. More...
 
virtual void  SignCMSContainerWithBaselineLTAProfile (IExternalSignature externalSignature, PdfReader inputDocument, Stream outputStream, String signatureFieldName, CMSContainer cmsContainer)
  Follow-up step that signs prepared document with PAdES Baseline-LTA profile. More...
 

Detailed Description

Helper class to perform signing operation in two steps.

Helper class to perform signing operation in two steps.

Firstly CreateCMSContainerWithoutSignature(iText.Commons.Bouncycastle.Cert.IX509Certificate[], System.String, iText.Kernel.Pdf.PdfReader, System.IO.Stream, SignerProperties) prepares document and placeholder for future signature without actual signing process.

Secondly follow-up step signs prepared document with corresponding PAdES Baseline profile.

Constructor & Destructor Documentation

◆ PadesTwoPhaseSigningHelper()

iText.Signatures.PadesTwoPhaseSigningHelper.PadesTwoPhaseSigningHelper ( )
inline

Create instance of PadesTwoPhaseSigningHelper.

Create instance of PadesTwoPhaseSigningHelper.

Same instance shall not be used for different signing operations, but can be used for both CreateCMSContainerWithoutSignature(iText.Commons.Bouncycastle.Cert.IX509Certificate[], System.String, iText.Kernel.Pdf.PdfReader, System.IO.Stream, SignerProperties) and follow-up signing.

Member Function Documentation

◆ CreateCMSContainerWithoutSignature()

virtual CMSContainer iText.Signatures.PadesTwoPhaseSigningHelper.CreateCMSContainerWithoutSignature ( IX509Certificate[]  certificates,
String  digestAlgorithm,
PdfReader  inputDocument,
Stream  outputStream,
SignerProperties  signerProperties 
)
inlinevirtual

Creates CMS container compliant with PAdES level.

Creates CMS container compliant with PAdES level. Prepares document and placeholder for the future signature without actual signing process.

Parameters
certificates certificates to be added to the CMS container
digestAlgorithm the algorithm to generate the digest with
inputDocument reader iText.Kernel.Pdf.PdfReader instance to read original PDF file
outputStream

System.IO.Stream output stream to write the resulting PDF file into

Parameters
signerProperties properties to be used in the signing operations
Returns
prepared CMS container without signature.

◆ SetCrlClient()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetCrlClient ( ICrlClient  crlClient )
inlinevirtual

Set ICrlClient to be used for LTV Verification.

Set ICrlClient to be used for LTV Verification.

This setter is only relevant if Baseline-LT Profile level or higher is used.

If none is set, there will be an attempt to create default CRL Client instance using the certificate chain.

Parameters
crlClient

ICrlClient instance to be used for LTV Verification

Returns
same instance of PadesTwoPhaseSigningHelper

◆ SetEstimatedSize()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetEstimatedSize ( int  estimatedSize )
inlinevirtual

Set estimated size of a signature to be applied.

Set estimated size of a signature to be applied.

This parameter represents estimated amount of bytes to be preserved for the signature.

If none is set, 0 will be used and the required space will be calculated during the signing.

Parameters
estimatedSize amount of bytes to be used as estimated value
Returns
same instance of PadesTwoPhaseSigningHelper

◆ SetIssuingCertificateRetriever()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetIssuingCertificateRetriever ( IIssuingCertificateRetriever  issuingCertificateRetriever )
inlinevirtual

Set IIssuingCertificateRetriever to be used before main signing operation.

Set IIssuingCertificateRetriever to be used before main signing operation.

If none is set, IssuingCertificateRetriever instance will be used instead.

Parameters
issuingCertificateRetriever

IIssuingCertificateRetriever instance to be used for getting missing certificates in chain or CRL response issuer certificates.

Returns
same instance of PadesTwoPhaseSigningHelper.

◆ SetOcspClient()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetOcspClient ( IOcspClient  ocspClient )
inlinevirtual

Set IOcspClient to be used for LTV Verification.

Set IOcspClient to be used for LTV Verification.

This setter is only relevant if Baseline-LT Profile level or higher is used.

If none is set, there will be an attempt to create default OCSP Client instance using the certificate chain.

Parameters
ocspClient

IOcspClient instance to be used for LTV Verification

Returns
same instance of PadesTwoPhaseSigningHelper

◆ SetStampingProperties()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.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 PadesTwoPhaseSigningHelper

◆ SetTemporaryDirectoryPath()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetTemporaryDirectoryPath ( String  temporaryDirectoryPath )
inlinevirtual

Set temporary directory to be used for temporary files creation.

Set temporary directory to be used for temporary files creation.

If none is set, temporary documents will be created in memory.

Parameters
temporaryDirectoryPath

System.String representing relative or absolute path to the directory

Returns
same instance of PadesTwoPhaseSigningHelper

◆ SetTimestampSignatureName()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetTimestampSignatureName ( String  timestampSignatureName )
inlinevirtual

Set the name to be used for timestamp signature creation.

Set the name to be used for timestamp signature creation.

This setter is only relevant if PdfPadesSigner.SignWithBaselineLTAProfile(SignerProperties, iText.Commons.Bouncycastle.Cert.IX509Certificate[], IExternalSignature, ITSAClient) or PdfPadesSigner.ProlongSignatures() methods are used.

If none is set, randomly generated signature name will be used.

Parameters
timestampSignatureName

System.String representing the name of a timestamp signature to be applied

Returns
same instance of PadesTwoPhaseSigningHelper

◆ SetTrustedCertificates()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetTrustedCertificates ( IList< IX509Certificate certificateList )
inlinevirtual

Set certificate list to be used by the IIssuingCertificateRetriever to retrieve missing certificates.

Parameters
certificateList certificate list for getting missing certificates in chain or CRL response issuer certificates.
Returns
same instance of PadesTwoPhaseSigningHelper.

◆ SetTSAClient()

virtual iText.Signatures.PadesTwoPhaseSigningHelper iText.Signatures.PadesTwoPhaseSigningHelper.SetTSAClient ( ITSAClient  tsaClient )
inlinevirtual

Set ITSAClient to be used for timestamp signature creation.

Set ITSAClient to be used for timestamp signature creation.

This client has to be set for Baseline-T Profile level and higher.

Parameters
tsaClient

ITSAClient instance to be used for timestamp signature creation.

Returns
same instance of PadesTwoPhaseSigningHelper

◆ SignCMSContainerWithBaselineBProfile()

virtual void iText.Signatures.PadesTwoPhaseSigningHelper.SignCMSContainerWithBaselineBProfile ( IExternalSignature  externalSignature,
PdfReader  inputDocument,
Stream  outputStream,
String  signatureFieldName,
CMSContainer  cmsContainer 
)
inlinevirtual

Follow-up step that signs prepared document with PAdES Baseline-B profile.

Parameters
externalSignature external signature to do the actual signing
inputDocument reader iText.Kernel.Pdf.PdfReader instance to read prepared document
outputStream the output PDF
signatureFieldName the field to sign
cmsContainer the finalized CMS container (e.g. created in the first step)

◆ SignCMSContainerWithBaselineLTAProfile()

virtual void iText.Signatures.PadesTwoPhaseSigningHelper.SignCMSContainerWithBaselineLTAProfile ( IExternalSignature  externalSignature,
PdfReader  inputDocument,
Stream  outputStream,
String  signatureFieldName,
CMSContainer  cmsContainer 
)
inlinevirtual

Follow-up step that signs prepared document with PAdES Baseline-LTA profile.

Parameters
externalSignature external signature to do the actual signing
inputDocument reader iText.Kernel.Pdf.PdfReader instance to read prepared document
outputStream the output PDF
signatureFieldName the field to sign
cmsContainer the finalized CMS container (e.g. created in the first step)

◆ SignCMSContainerWithBaselineLTProfile()

virtual void iText.Signatures.PadesTwoPhaseSigningHelper.SignCMSContainerWithBaselineLTProfile ( IExternalSignature  externalSignature,
PdfReader  inputDocument,
Stream  outputStream,
String  signatureFieldName,
CMSContainer  cmsContainer 
)
inlinevirtual

Follow-up step that signs prepared document with PAdES Baseline-LT profile.

Parameters
externalSignature external signature to do the actual signing
inputDocument reader iText.Kernel.Pdf.PdfReader instance to read prepared document
outputStream the output PDF
signatureFieldName the field to sign
cmsContainer the finalized CMS container (e.g. created in the first step)

◆ SignCMSContainerWithBaselineTProfile()

virtual void iText.Signatures.PadesTwoPhaseSigningHelper.SignCMSContainerWithBaselineTProfile ( IExternalSignature  externalSignature,
PdfReader  inputDocument,
Stream  outputStream,
String  signatureFieldName,
CMSContainer  cmsContainer 
)
inlinevirtual

Follow-up step that signs prepared document with PAdES Baseline-T profile.

Parameters
externalSignature external signature to do the actual signing
inputDocument reader iText.Kernel.Pdf.PdfReader instance to read prepared document
outputStream the output PDF
signatureFieldName the field to sign
cmsContainer the finalized CMS container (e.g. created in the first step)