Class PdfPadesSigner
- Namespace
- iText.Signatures
- Assembly
- itext.sign.dll
This class performs signing with PaDES related profiles using provided parameters.
public class PdfPadesSigner
- Inheritance
-
PdfPadesSigner
- Inherited Members
Constructors
PdfPadesSigner(PdfReader, Stream)
Create an instance of PdfPadesSigner class.
public PdfPadesSigner(PdfReader reader, Stream outputStream)
Parameters
reader
PdfReaderPdfReader instance to read original PDF file
outputStream
StreamStream output stream to write the resulting PDF file into
Remarks
Create an instance of PdfPadesSigner class. One instance shall be used for one signing operation.
Methods
ProlongSignatures()
Add revocation information for all the signatures which could be found in the provided document.
public virtual void ProlongSignatures()
ProlongSignatures(ITSAClient)
Add revocation information for all the signatures which could be found in the provided document.
public virtual void ProlongSignatures(ITSAClient tsaClient)
Parameters
tsaClient
ITSAClientITSAClient TSA Client to be used for timestamp signature creation
Remarks
Add revocation information for all the signatures which could be found in the provided document. Also add timestamp signature on top of that.
SetCertificationLevel(AccessPermissions)
Set certification level which specifies DocMDP level which is expected to be set.
public virtual PdfPadesSigner SetCertificationLevel(AccessPermissions accessPermissions)
Parameters
accessPermissions
AccessPermissionsAccessPermissions certification level
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
SetCrlClient(ICrlClient)
Set ICrlClient to be used for LTV Verification.
public virtual PdfPadesSigner SetCrlClient(ICrlClient crlClient)
Parameters
crlClient
ICrlClientICrlClient instance to be used for LTV Verification
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
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.SetEstimatedSize(int)
Set estimated size of a signature to be applied.
public virtual PdfPadesSigner SetEstimatedSize(int estimatedSize)
Parameters
estimatedSize
intamount of bytes to be used as estimated value
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
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.SetExternalDigest(IExternalDigest)
Set IExternalDigest to be used for main signing operation.
public virtual PdfPadesSigner SetExternalDigest(IExternalDigest externalDigest)
Parameters
externalDigest
IExternalDigestIExternalDigest to be used for main signing operation.
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
Set IExternalDigest to be used for main signing operation.
If none is set, BouncyCastleDigest instance will be used instead.SetIssuingCertificateRetriever(IIssuingCertificateRetriever)
Set IIssuingCertificateRetriever to be used before main signing operation.
public virtual PdfPadesSigner SetIssuingCertificateRetriever(IIssuingCertificateRetriever issuingCertificateRetriever)
Parameters
issuingCertificateRetriever
IIssuingCertificateRetrieverIIssuingCertificateRetriever instance to be used for getting missing certificates in chain or CRL response issuer certificates.
Returns
- PdfPadesSigner
same instance of PdfPadesSigner.
Remarks
Set IIssuingCertificateRetriever to be used before main signing operation.
If none is set, IssuingCertificateRetriever instance will be used instead.SetOcspClient(IOcspClient)
Set IOcspClient to be used for LTV Verification.
public virtual PdfPadesSigner SetOcspClient(IOcspClient ocspClient)
Parameters
ocspClient
IOcspClientIOcspClient instance to be used for LTV Verification
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
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.SetSignatureFieldLock(PdfSigFieldLock)
Set FieldMDP rules to be applied for this signature.
public virtual PdfPadesSigner SetSignatureFieldLock(PdfSigFieldLock fieldLock)
Parameters
fieldLock
PdfSigFieldLockPdfSigFieldLock field lock dictionary.
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
SetStampingProperties(StampingProperties)
Set stamping properties to be used during main signing operation.
public virtual PdfPadesSigner SetStampingProperties(StampingProperties stampingProperties)
Parameters
stampingProperties
StampingPropertiesStampingProperties instance to be used during main signing operation
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
Set stamping properties to be used during main signing operation.
If none is set, stamping properties with append mode enabled will be usedSetTemporaryDirectoryPath(string)
Set temporary directory to be used for temporary files creation.
public virtual PdfPadesSigner SetTemporaryDirectoryPath(string temporaryDirectoryPath)
Parameters
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
Set temporary directory to be used for temporary files creation.
If none is set, temporary documents will be created in memory.SetTimestampSignatureName(string)
Set the name to be used for timestamp signature creation.
public virtual PdfPadesSigner SetTimestampSignatureName(string timestampSignatureName)
Parameters
Returns
- PdfPadesSigner
same instance of PdfPadesSigner
Remarks
Set the name to be used for timestamp signature creation.
This setter is only relevant if SignWithBaselineLTAProfile(SignerProperties, IX509Certificate[], IExternalSignature, ITSAClient) or ProlongSignatures() methods are used. If none is set, randomly generated signature name will be used.SetTrustedCertificates(IList<IX509Certificate>)
Set certificate list to be used by the IIssuingCertificateRetriever to retrieve missing certificates.
public virtual PdfPadesSigner SetTrustedCertificates(IList<IX509Certificate> certificateList)
Parameters
certificateList
IList<IX509Certificate>certificate list for getting missing certificates in chain or CRL response issuer certificates.
Returns
- PdfPadesSigner
same instance of PdfPadesSigner.
SignWithBaselineBProfile(SignerProperties, IX509Certificate[], IPrivateKey)
Sign the document provided in PdfSigner instance with PaDES Baseline-B Profile.
public virtual void SignWithBaselineBProfile(SignerProperties signerProperties, IX509Certificate[] chain, IPrivateKey privateKey)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
privateKey
IPrivateKeyiText.Commons.Bouncycastle.Crypto.IPrivateKey instance to be used for main signing operation
SignWithBaselineBProfile(SignerProperties, IX509Certificate[], IExternalSignature)
Sign the document provided in PdfSigner instance with PaDES Baseline-B Profile.
public virtual void SignWithBaselineBProfile(SignerProperties signerProperties, IX509Certificate[] chain, IExternalSignature externalSignature)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
externalSignature
IExternalSignatureIExternalSignature instance to be used for main signing operation
SignWithBaselineLTAProfile(SignerProperties, IX509Certificate[], IPrivateKey, ITSAClient)
Sign the document provided in PdfSigner instance with PaDES Baseline-LTA Profile.
public virtual void SignWithBaselineLTAProfile(SignerProperties signerProperties, IX509Certificate[] chain, IPrivateKey privateKey, ITSAClient tsaClient)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
privateKey
IPrivateKeyiText.Commons.Bouncycastle.Crypto.IPrivateKey instance to be used for main signing operation
tsaClient
ITSAClientITSAClient instance to be used for timestamp creation
SignWithBaselineLTAProfile(SignerProperties, IX509Certificate[], IExternalSignature, ITSAClient)
Sign the document provided in PdfSigner instance with PaDES Baseline-LTA Profile.
public virtual void SignWithBaselineLTAProfile(SignerProperties signerProperties, IX509Certificate[] chain, IExternalSignature externalSignature, ITSAClient tsaClient)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
externalSignature
IExternalSignatureIExternalSignature instance to be used for main signing operation
tsaClient
ITSAClientITSAClient instance to be used for timestamp creation
SignWithBaselineLTProfile(SignerProperties, IX509Certificate[], IPrivateKey, ITSAClient)
Sign the document provided in PdfSigner instance with PaDES Baseline-LT Profile.
public virtual void SignWithBaselineLTProfile(SignerProperties signerProperties, IX509Certificate[] chain, IPrivateKey privateKey, ITSAClient tsaClient)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
privateKey
IPrivateKeyiText.Commons.Bouncycastle.Crypto.IPrivateKey instance to be used for main signing operation
tsaClient
ITSAClientITSAClient instance to be used for timestamp creation
SignWithBaselineLTProfile(SignerProperties, IX509Certificate[], IExternalSignature, ITSAClient)
Sign the document provided in PdfSigner instance with PaDES Baseline-LT Profile.
public virtual void SignWithBaselineLTProfile(SignerProperties signerProperties, IX509Certificate[] chain, IExternalSignature externalSignature, ITSAClient tsaClient)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
externalSignature
IExternalSignatureIExternalSignature instance to be used for main signing operation
tsaClient
ITSAClientITSAClient instance to be used for timestamp creation
SignWithBaselineTProfile(SignerProperties, IX509Certificate[], IPrivateKey, ITSAClient)
Sign the document provided in PdfSigner instance with PaDES Baseline-T Profile.
public virtual void SignWithBaselineTProfile(SignerProperties signerProperties, IX509Certificate[] chain, IPrivateKey privateKey, ITSAClient tsaClient)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
privateKey
IPrivateKeyiText.Commons.Bouncycastle.Crypto.IPrivateKey instance to be used for main signing operation
tsaClient
ITSAClientITSAClient instance to be used for timestamp creation
SignWithBaselineTProfile(SignerProperties, IX509Certificate[], IExternalSignature, ITSAClient)
Sign the document provided in PdfSigner instance with PaDES Baseline-T Profile.
public virtual void SignWithBaselineTProfile(SignerProperties signerProperties, IX509Certificate[] chain, IExternalSignature externalSignature, ITSAClient tsaClient)
Parameters
signerProperties
SignerPropertiesSignerProperties properties to be used for main signing operation
chain
IX509Certificate[]the chain of certificates to be used for signing operation
externalSignature
IExternalSignatureIExternalSignature instance to be used for main signing operation
tsaClient
ITSAClientITSAClient instance to be used for timestamp creation