Class PdfSigner
- Namespace
- iText.Signatures
- Assembly
- itext.sign.dll
Takes care of the cryptographic options and appearances that form a signature.
public class PdfSigner
- Inheritance
-
PdfSigner
- Inherited Members
Constructors
PdfSigner(PdfReader, Stream, string, StampingProperties)
Creates a PdfSigner instance.
public PdfSigner(PdfReader reader, Stream outputStream, string path, StampingProperties properties)
Parameters
reader
PdfReaderPdfReader that reads the PDF file
outputStream
StreamOutputStream to write the signed PDF file
path
stringFile to which the output is temporarily written
properties
StampingPropertiesStampingProperties for the signing document. Note that encryption will be preserved regardless of what is set in properties.
Remarks
Creates a PdfSigner instance. Uses a MemoryStream instead of a temporary file.
PdfSigner(PdfReader, Stream, string, StampingProperties, SignerProperties)
Creates a PdfSigner instance.
public PdfSigner(PdfReader reader, Stream outputStream, string path, StampingProperties stampingProperties, SignerProperties signerProperties)
Parameters
reader
PdfReaderPdfReader that reads the PDF file
outputStream
StreamOutputStream to write the signed PDF file
path
stringFile to which the output is temporarily written
stampingProperties
StampingPropertiesStampingProperties for the signing document. Note that encryption will be preserved regardless of what is set in properties.
signerProperties
SignerPropertiesSignerProperties bundled properties to be used in signing operations.
Remarks
Creates a PdfSigner instance. Uses a MemoryStream instead of a temporary file.
PdfSigner(PdfReader, Stream, StampingProperties)
Creates a PdfSigner instance.
public PdfSigner(PdfReader reader, Stream outputStream, StampingProperties properties)
Parameters
reader
PdfReaderPdfReader that reads the PDF file
outputStream
StreamOutputStream to write the signed PDF file
properties
StampingPropertiesStampingProperties for the signing document. Note that encryption will be preserved regardless of what is set in properties.
Remarks
Creates a PdfSigner instance. Uses a MemoryStream instead of a temporary file.
Fields
CERTIFIED_FORM_FILLING
Author signature, form filling allowed.
public const int CERTIFIED_FORM_FILLING = 2
Field Value
CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
Author signature, form filling and annotations allowed.
public const int CERTIFIED_FORM_FILLING_AND_ANNOTATIONS = 3
Field Value
CERTIFIED_NO_CHANGES_ALLOWED
Author signature, no changes allowed.
public const int CERTIFIED_NO_CHANGES_ALLOWED = 1
Field Value
NOT_CERTIFIED
Approval signature.
public const int NOT_CERTIFIED = 0
Field Value
appearance
The signature appearance.
protected PdfSignatureAppearance appearance
Field Value
bout
The bytes of the file right before the signature is added (if raf is null).
protected byte[] bout
Field Value
- byte[]
certificationLevel
The certification level.
protected int certificationLevel
Field Value
closed
Boolean to check if this PdfSigner instance has been closed already or not.
protected bool closed
Field Value
cryptoDictionary
The crypto dictionary.
protected PdfSignature cryptoDictionary
Field Value
document
The PdfDocument.
protected PdfDocument document
Field Value
exclusionLocations
Name and content of keys that can only be added in the close() method.
protected IDictionary<PdfName, PdfLiteral> exclusionLocations
Field Value
fieldLock
Signature field lock dictionary.
protected PdfSigFieldLock fieldLock
Field Value
fieldName
The name of the field.
protected string fieldName
Field Value
originalOS
OutputStream for the bytes of the document.
protected Stream originalOS
Field Value
preClosed
Indicates if the pdf document has already been pre-closed.
protected bool preClosed
Field Value
raf
The file right before the signature is added (can be null).
protected FileStream raf
Field Value
range
Array containing the byte positions of the bytes that need to be hashed.
protected long[] range
Field Value
- long[]
signDate
Holds value of property signDate.
protected DateTime signDate
Field Value
signatureEvent
Holds value of property signatureEvent.
protected PdfSigner.ISignatureEvent signatureEvent
Field Value
tempFile
Tempfile to hold the output temporarily.
protected FileInfo tempFile
Field Value
temporaryOS
Outputstream that temporarily holds the output in memory.
protected MemoryStream temporaryOS
Field Value
Methods
AddDeveloperExtension(PdfDeveloperExtension)
Add developer extension to the current PdfDocument.
protected virtual void AddDeveloperExtension(PdfDeveloperExtension extension)
Parameters
extension
PdfDeveloperExtensionPdfDeveloperExtension to be added
AddDocMDP(PdfSignature)
Adds keys to the signature dictionary that define the certification level and the permissions.
protected virtual void AddDocMDP(PdfSignature crypto)
Parameters
crypto
PdfSignaturethe signature dictionary
Remarks
Adds keys to the signature dictionary that define the certification level and the permissions. This method is only used for Certifying signatures.
AddFieldMDP(PdfSignature, PdfSigFieldLock)
Adds keys to the signature dictionary that define the field permissions.
protected virtual void AddFieldMDP(PdfSignature crypto, PdfSigFieldLock fieldLock)
Parameters
crypto
PdfSignaturethe signature dictionary
fieldLock
PdfSigFieldLockthe PdfSigFieldLock instance specified the field lock to be set
Remarks
Adds keys to the signature dictionary that define the field permissions. This method is only used for signatures that lock fields.
Close(PdfDictionary)
This is the last method to be called when using external signatures.
protected virtual void Close(PdfDictionary update)
Parameters
update
PdfDictionarya PdfDictionary with the key/value that will fill the holes defined in
Remarks
This is the last method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().
update is a PdfDictionary that must have exactly the same keys as the ones provided inCreateNewSignatureFormField(PdfAcroForm, string)
Creates new signature form field and adds it to the acroForm object.
protected virtual PdfSigFieldLock CreateNewSignatureFormField(PdfAcroForm acroForm, string name)
Parameters
acroForm
PdfAcroFormPdfAcroForm object in which new signature field will be added
name
stringthe name of the field
Returns
- PdfSigFieldLock
signature field lock dictionary
Remarks
Creates new signature form field and adds it to the acroForm object.
This method is called during the
DocumentContainsCertificationOrApprovalSignatures()
Check if current document instance already contains certification or approval signatures.
protected virtual bool DocumentContainsCertificationOrApprovalSignatures()
Returns
GetCertificationLevel()
Returns the document's certification level.
public virtual int GetCertificationLevel()
Returns
- int
The certified status.
Remarks
Returns the document's certification level. For possible values see SetCertificationLevel(int).
GetContact()
Returns the signing contact.
public virtual string GetContact()
Returns
- string
The signing contact.
GetDocument()
Gets the PdfDocument associated with this instance.
public virtual PdfDocument GetDocument()
Returns
- PdfDocument
the PdfDocument associated with this instance
GetFieldLockDict()
Getter for the field lock dictionary.
public virtual PdfSigFieldLock GetFieldLockDict()
Returns
- PdfSigFieldLock
Field lock dictionary.
GetFieldName()
Gets the field name.
public virtual string GetFieldName()
Returns
- string
the field name
GetLocation()
Returns the signing location.
public virtual string GetLocation()
Returns
- string
The signing location.
GetNewSigFieldName()
Gets a new signature field name that doesn't clash with any existing name.
public virtual string GetNewSigFieldName()
Returns
- string
A new signature field name.
GetPageNumber()
Provides the page number of the signature field which this signature appearance is associated with.
public virtual int GetPageNumber()
Returns
- int
The page number of the signature field which this signature appearance is associated with.
GetPageRect()
Provides the rectangle that represent the position and dimension of the signature field in the page.
public virtual Rectangle GetPageRect()
Returns
- Rectangle
the rectangle that represent the position and dimension of the signature field in the page
GetRangeStream()
Gets the document bytes that are hashable when using external signatures.
protected virtual Stream GetRangeStream()
Returns
Remarks
Gets the document bytes that are hashable when using external signatures.
The general sequence is:
GetReason()
Returns the signing reason.
public virtual string GetReason()
Returns
- string
The signing reason.
GetSignDate()
Gets the signature date.
public virtual DateTime GetSignDate()
Returns
- DateTime
Calendar set to the signature date
GetSignatureAppearance()
Provides access to a signature appearance object.
[Obsolete]
public virtual PdfSignatureAppearance GetSignatureAppearance()
Returns
Remarks
Provides access to a signature appearance object. Use it to customize the appearance of the signature.
Be aware:- If you create new signature field (either use SetFieldName(string) with the name that doesn't exist in the document or don't specify it at all) then the signature is invisible by default.
- If you sign already existing field, then the signature appearance object is modified to have all the properties (page num., rect etc.) consistent with the state of the field (if you customized the appearance object before the SetFieldName(string) call you'll have to do it again)
GetSignatureCreator()
Returns the signature creator.
public virtual string GetSignatureCreator()
Returns
- string
The signature creator.
GetSignatureDictionary()
Returns the user made signature dictionary.
public virtual PdfSignature GetSignatureDictionary()
Returns
- PdfSignature
The user made signature dictionary.
Remarks
Returns the user made signature dictionary. This is the dictionary at the /V key of the signature field.
GetSignatureEvent()
Getter for property signatureEvent.
public virtual PdfSigner.ISignatureEvent GetSignatureEvent()
Returns
- PdfSigner.ISignatureEvent
Value of property signatureEvent.
GetSignatureField()
Gets the signature field to be signed.
public virtual PdfSignatureFormField GetSignatureField()
Returns
- PdfSignatureFormField
the PdfSignatureFormField instance.
Remarks
Gets the signature field to be signed. The field can already be presented in the document. If the field is not presented in the document, it will be created.
This field instance is expected to be used for setting appearance related properties such as SetReuseAppearance(bool) , SetBackgroundLayer(PdfFormXObject) and SetSignatureAppearanceLayer(PdfFormXObject).GetUnderlyingSource()
Returns the underlying source.
protected virtual IRandomAccessSource GetUnderlyingSource()
Returns
- IRandomAccessSource
the underlying source
GetWidgetPageNumber(PdfWidgetAnnotation)
Get the page number associated to the provided widget.
protected virtual int GetWidgetPageNumber(PdfWidgetAnnotation widget)
Parameters
widget
PdfWidgetAnnotationPdfWidgetAnnotation from which to extract the page number
Returns
- int
page number
GetWidgetRectangle(PdfWidgetAnnotation)
Get the rectangle associated to the provided widget.
protected virtual Rectangle GetWidgetRectangle(PdfWidgetAnnotation widget)
Parameters
widget
PdfWidgetAnnotationPdfWidgetAnnotation to extract the rectangle from
Returns
- Rectangle
Rectangle
InitDocument(PdfReader, PdfWriter, StampingProperties)
Initialize new PdfDocument instance by using provided parameters.
protected virtual PdfDocument InitDocument(PdfReader reader, PdfWriter writer, StampingProperties properties)
Parameters
reader
PdfReaderPdfReader to be used as a reader in the new document
writer
PdfWriterPdfWriter to be used as a writer in the new document
properties
StampingPropertiesStampingProperties to be provided in the new document
Returns
- PdfDocument
new PdfDocument instance
IsPreClosed()
Checks if the document is in the process of closing.
protected virtual bool IsPreClosed()
Returns
- bool
true if the document is in the process of closing, false otherwise
PopulateExistingSignatureFormField(PdfAcroForm)
Populates already existing signature form field in the acroForm object.
protected virtual PdfSigFieldLock PopulateExistingSignatureFormField(PdfAcroForm acroForm)
Parameters
acroForm
PdfAcroFormPdfAcroForm object in which the signature field will be populated
Returns
- PdfSigFieldLock
signature field lock dictionary
Remarks
Populates already existing signature form field in the acroForm object.
This method is called during the
PreClose(IDictionary<PdfName, int?>)
This is the first method to be called when using external signatures.
protected virtual void PreClose(IDictionary<PdfName, int?> exclusionSizes)
Parameters
exclusionSizes
IDictionary<PdfName, int?>Map with names and sizes to be excluded in the signature calculation. The key is a PdfName and the value an Integer. At least the /Contents must be present
Remarks
This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().
exclusionSizes
must contain at least
the PdfName.CONTENTS
key with the size that it will take in the
document. Note that due to the hex string coding this size should be byte_size*2+2.
ProcessCrl(IX509Certificate, ICollection<ICrlClient>)
Processes a CRL list.
protected virtual ICollection<byte[]> ProcessCrl(IX509Certificate cert, ICollection<ICrlClient> crlList)
Parameters
cert
IX509Certificatea Certificate if one of the CrlList implementations needs to retrieve the CRL URL from it.
crlList
ICollection<ICrlClient>a list of CrlClient implementations
Returns
- ICollection<byte[]>
a collection of CRL bytes that can be embedded in a PDF
SetCertificationLevel(int)
Sets the document's certification level.
public virtual void SetCertificationLevel(int certificationLevel)
Parameters
certificationLevel
inta new certification level for a document. Possible values are:
Remarks
Sets the document's certification level. This method overrides the value set by SetCertificationLevel(AccessPermissions).
SetCertificationLevel(AccessPermissions)
Sets the document's certification level.
public virtual void SetCertificationLevel(AccessPermissions accessPermissions)
Parameters
accessPermissions
AccessPermissionsAccessPermissions enum which specifies which certification level shall be used
Remarks
Sets the document's certification level. This method overrides the value set by SetCertificationLevel(int).
SetContact(string)
Sets the signing contact.
public virtual PdfSigner SetContact(string contact)
Parameters
contact
stringA new signing contact.
Returns
- PdfSigner
this instance to support fluent interface.
SetDocument(PdfDocument)
Sets the PdfDocument.
protected virtual void SetDocument(PdfDocument document)
Parameters
document
PdfDocumentThe PdfDocument
SetFieldLockDict(PdfSigFieldLock)
Setter for the field lock dictionary.
public virtual void SetFieldLockDict(PdfSigFieldLock fieldLock)
Parameters
fieldLock
PdfSigFieldLockField lock dictionary
Remarks
Setter for the field lock dictionary.
Be aware: if a signature is created on an existing signature field, then its /Lock dictionary takes the precedence (if it exists).SetFieldName(string)
Sets the name indicating the field to be signed.
public virtual void SetFieldName(string fieldName)
Parameters
fieldName
stringThe name indicating the field to be signed.
Remarks
Sets the name indicating the field to be signed. The field can already be presented in the document but shall not be signed. If the field is not presented in the document, it will be created.
SetLocation(string)
Sets the signing location.
public virtual PdfSigner SetLocation(string location)
Parameters
location
stringA new signing location.
Returns
- PdfSigner
this instance to support fluent interface.
SetOriginalOutputStream(Stream)
Setter for the OutputStream.
public virtual void SetOriginalOutputStream(Stream originalOS)
Parameters
originalOS
StreamOutputStream for the bytes of the document
SetPageNumber(int)
Sets the page number of the signature field which this signature appearance is associated with.
public virtual PdfSigner SetPageNumber(int pageNumber)
Parameters
pageNumber
intThe page number of the signature field which this signature appearance is associated with.
Returns
- PdfSigner
this instance to support fluent interface.
Remarks
Sets the page number of the signature field which this signature appearance is associated with. Implicitly calls SetPageRect(Rectangle) which considers page number to process the rectangle correctly.
SetPageRect(Rectangle)
Sets the rectangle that represent the position and dimension of the signature field in the page.
public virtual PdfSigner SetPageRect(Rectangle pageRect)
Parameters
pageRect
RectangleThe rectangle that represents the position and dimension of the signature field in the page.
Returns
- PdfSigner
this instance to support fluent interface.
SetReason(string)
Sets the signing reason.
public virtual PdfSigner SetReason(string reason)
Parameters
reason
stringA new signing reason.
Returns
- PdfSigner
this instance to support fluent interface.
SetSignDate(DateTime)
Sets the signature date.
public virtual void SetSignDate(DateTime signDate)
Parameters
signDate
DateTimethe signature date
SetSignatureAppearance(SignatureFieldAppearance)
Sets the signature field layout element to customize the appearance of the signature.
public virtual void SetSignatureAppearance(SignatureFieldAppearance appearance)
Parameters
appearance
SignatureFieldAppearancethe SignatureFieldAppearance layout element.
Remarks
Sets the signature field layout element to customize the appearance of the signature. Signer's sign date will be set.
SetSignatureCreator(string)
Sets the name of the application used to create the signature.
public virtual PdfSigner SetSignatureCreator(string signatureCreator)
Parameters
signatureCreator
stringA new name of the application signing a document.
Returns
- PdfSigner
this instance to support fluent interface.
SetSignatureEvent(ISignatureEvent)
Sets the signature event to allow modification of the signature dictionary.
public virtual void SetSignatureEvent(PdfSigner.ISignatureEvent signatureEvent)
Parameters
signatureEvent
PdfSigner.ISignatureEventthe signature event
SignDeferred(PdfDocument, string, Stream, IExternalSignatureContainer)
Signs a PDF where space was already reserved.
public static void SignDeferred(PdfDocument document, string fieldName, Stream outs, IExternalSignatureContainer externalSignatureContainer)
Parameters
document
PdfDocumentthe original PDF
fieldName
stringthe field to sign. It must be the last field
outs
Streamthe output PDF
externalSignatureContainer
IExternalSignatureContainerthe signature container doing the actual signing. Only the method ExternalSignatureContainer.sign is used
SignDetached(IExternalDigest, IExternalSignature, IX509Certificate[], ICollection<ICrlClient>, IOcspClient, ITSAClient, int, CryptoStandard)
Signs the document using the detached mode, CMS or CAdES equivalent.
public virtual void SignDetached(IExternalDigest externalDigest, IExternalSignature externalSignature, IX509Certificate[] chain, ICollection<ICrlClient> crlList, IOcspClient ocspClient, ITSAClient tsaClient, int estimatedSize, PdfSigner.CryptoStandard sigtype)
Parameters
externalDigest
IExternalDigestan implementation that provides the digest
externalSignature
IExternalSignaturethe interface providing the actual signing
chain
IX509Certificate[]the certificate chain
crlList
ICollection<ICrlClient>the CRL list
ocspClient
IOcspClientthe OCSP client
tsaClient
ITSAClientthe Timestamp client
estimatedSize
intthe reserved size for the signature. It will be estimated if 0
sigtype
PdfSigner.CryptoStandardEither Signature.CMS or Signature.CADES
Remarks
Signs the document using the detached mode, CMS or CAdES equivalent.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
SignDetached(IExternalDigest, IExternalSignature, IX509Certificate[], ICollection<ICrlClient>, IOcspClient, ITSAClient, int, CryptoStandard, ISignaturePolicyIdentifier)
Signs the document using the detached mode, CMS or CAdES equivalent.
public virtual void SignDetached(IExternalDigest externalDigest, IExternalSignature externalSignature, IX509Certificate[] chain, ICollection<ICrlClient> crlList, IOcspClient ocspClient, ITSAClient tsaClient, int estimatedSize, PdfSigner.CryptoStandard sigtype, ISignaturePolicyIdentifier signaturePolicy)
Parameters
externalDigest
IExternalDigestan implementation that provides the digest
externalSignature
IExternalSignaturethe interface providing the actual signing
chain
IX509Certificate[]the certificate chain
crlList
ICollection<ICrlClient>the CRL list
ocspClient
IOcspClientthe OCSP client
tsaClient
ITSAClientthe Timestamp client
estimatedSize
intthe reserved size for the signature. It will be estimated if 0
sigtype
PdfSigner.CryptoStandardEither Signature.CMS or Signature.CADES
signaturePolicy
ISignaturePolicyIdentifierthe signature policy (for EPES signatures)
Remarks
Signs the document using the detached mode, CMS or CAdES equivalent.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
SignDetached(IExternalDigest, IExternalSignature, IX509Certificate[], ICollection<ICrlClient>, IOcspClient, ITSAClient, int, CryptoStandard, SignaturePolicyInfo)
Signs the document using the detached mode, CMS or CAdES equivalent.
public virtual void SignDetached(IExternalDigest externalDigest, IExternalSignature externalSignature, IX509Certificate[] chain, ICollection<ICrlClient> crlList, IOcspClient ocspClient, ITSAClient tsaClient, int estimatedSize, PdfSigner.CryptoStandard sigtype, SignaturePolicyInfo signaturePolicy)
Parameters
externalDigest
IExternalDigestan implementation that provides the digest
externalSignature
IExternalSignaturethe interface providing the actual signing
chain
IX509Certificate[]the certificate chain
crlList
ICollection<ICrlClient>the CRL list
ocspClient
IOcspClientthe OCSP client
tsaClient
ITSAClientthe Timestamp client
estimatedSize
intthe reserved size for the signature. It will be estimated if 0
sigtype
PdfSigner.CryptoStandardEither Signature.CMS or Signature.CADES
signaturePolicy
SignaturePolicyInfothe signature policy (for EPES signatures)
Remarks
Signs the document using the detached mode, CMS or CAdES equivalent.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
SignDetached(IExternalSignature, IX509Certificate[], ICollection<ICrlClient>, IOcspClient, ITSAClient, int, CryptoStandard)
Signs the document using the detached mode, CMS or CAdES equivalent.
public virtual void SignDetached(IExternalSignature externalSignature, IX509Certificate[] chain, ICollection<ICrlClient> crlList, IOcspClient ocspClient, ITSAClient tsaClient, int estimatedSize, PdfSigner.CryptoStandard sigtype)
Parameters
externalSignature
IExternalSignaturethe interface providing the actual signing
chain
IX509Certificate[]the certificate chain
crlList
ICollection<ICrlClient>the CRL list
ocspClient
IOcspClientthe OCSP client
tsaClient
ITSAClientthe Timestamp client
estimatedSize
intthe reserved size for the signature. It will be estimated if 0
sigtype
PdfSigner.CryptoStandardEither Signature.CMS or Signature.CADES
Remarks
Signs the document using the detached mode, CMS or CAdES equivalent.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
SignDetached(IExternalSignature, IX509Certificate[], ICollection<ICrlClient>, IOcspClient, ITSAClient, int, CryptoStandard, ISignaturePolicyIdentifier)
Signs the document using the detached mode, CMS or CAdES equivalent.
public virtual void SignDetached(IExternalSignature externalSignature, IX509Certificate[] chain, ICollection<ICrlClient> crlList, IOcspClient ocspClient, ITSAClient tsaClient, int estimatedSize, PdfSigner.CryptoStandard sigtype, ISignaturePolicyIdentifier signaturePolicy)
Parameters
externalSignature
IExternalSignaturethe interface providing the actual signing
chain
IX509Certificate[]the certificate chain
crlList
ICollection<ICrlClient>the CRL list
ocspClient
IOcspClientthe OCSP client
tsaClient
ITSAClientthe Timestamp client
estimatedSize
intthe reserved size for the signature. It will be estimated if 0
sigtype
PdfSigner.CryptoStandardEither Signature.CMS or Signature.CADES
signaturePolicy
ISignaturePolicyIdentifierthe signature policy (for EPES signatures)
Remarks
Signs the document using the detached mode, CMS or CAdES equivalent.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
SignDetached(IExternalSignature, IX509Certificate[], ICollection<ICrlClient>, IOcspClient, ITSAClient, int, CryptoStandard, SignaturePolicyInfo)
Signs the document using the detached mode, CMS or CAdES equivalent.
public virtual void SignDetached(IExternalSignature externalSignature, IX509Certificate[] chain, ICollection<ICrlClient> crlList, IOcspClient ocspClient, ITSAClient tsaClient, int estimatedSize, PdfSigner.CryptoStandard sigtype, SignaturePolicyInfo signaturePolicy)
Parameters
externalSignature
IExternalSignaturethe interface providing the actual signing
chain
IX509Certificate[]the certificate chain
crlList
ICollection<ICrlClient>the CRL list
ocspClient
IOcspClientthe OCSP client
tsaClient
ITSAClientthe Timestamp client
estimatedSize
intthe reserved size for the signature. It will be estimated if 0
sigtype
PdfSigner.CryptoStandardEither Signature.CMS or Signature.CADES
signaturePolicy
SignaturePolicyInfothe signature policy (for EPES signatures)
Remarks
Signs the document using the detached mode, CMS or CAdES equivalent.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
SignExternalContainer(IExternalSignatureContainer, int)
Sign the document using an external container, usually a PKCS7.
public virtual void SignExternalContainer(IExternalSignatureContainer externalSignatureContainer, int estimatedSize)
Parameters
externalSignatureContainer
IExternalSignatureContainerthe interface providing the actual signing
estimatedSize
intthe reserved size for the signature
Remarks
Sign the document using an external container, usually a PKCS7. The signature is fully composed
externally, iText will just put the container inside the document.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.
Timestamp(ITSAClient, string)
Signs a document with a PAdES-LTV Timestamp.
public virtual void Timestamp(ITSAClient tsa, string signatureName)
Parameters
tsa
ITSAClientthe timestamp generator
signatureName
stringthe signature name or null to have a name generated automatically
Remarks
Signs a document with a PAdES-LTV Timestamp. The document is closed at the end.
NOTE: This method closes the underlying pdf document. This means, that current instance
of PdfSigner cannot be used after this method call.