Class PdfSignature
- Namespace
- iText.Signatures
- Assembly
- itext.sign.dll
Represents the signature dictionary.
public class PdfSignature : PdfObjectWrapper<PdfDictionary>
- Inheritance
-
PdfSignature
- Inherited Members
Constructors
PdfSignature()
Creates new PdfSignature.
public PdfSignature()
PdfSignature(PdfDictionary)
Creates new PdfSignature instance from the provided PdfDictionary.
public PdfSignature(PdfDictionary sigDictionary)
Parameters
sigDictionary
PdfDictionaryPdfDictionary to create new PdfSignature instance from
PdfSignature(PdfName, PdfName)
Creates new PdfSignature.
public PdfSignature(PdfName filter, PdfName subFilter)
Parameters
filter
PdfNamePdfName of the signature handler to use when validating this signature
subFilter
PdfNamePdfName that describes the encoding of the signature
Methods
GetByteRange()
Gets the /ByteRange.
public virtual PdfArray GetByteRange()
Returns
- PdfArray
an array of pairs of integers that specifies the byte range used in the digest calculation. A pair consists of the starting byte offset and the length.
GetCert()
Gets the /Cert entry value of this signature.
public virtual PdfString GetCert()
Returns
- PdfString
the signature cert
Remarks
Gets the /Cert entry value of this signature. See ISO 32000-1 12.8.1, Table 252 – Entries in a signature dictionary.
GetCertObject()
Gets the /Cert entry value of this signature.
public virtual PdfObject GetCertObject()
Returns
- PdfObject
the signature cert value
Remarks
Gets the /Cert entry value of this signature. /Cert entry required when SubFilter is adbe.x509.rsa_sha1. May be array or byte string.
GetContents()
Gets the /Contents entry value.
public virtual PdfString GetContents()
Returns
- PdfString
the signature content
Remarks
Gets the /Contents entry value. See ISO 32000-1 12.8.1, Table 252 – Entries in a signature dictionary.
GetDate()
Gets the /M value.
public virtual PdfString GetDate()
Returns
Remarks
Gets the /M value. Should only be used if the time of signing is not available in the signature.
GetLocation()
Gets the /Location entry value.
public virtual string GetLocation()
Returns
- string
physical location of signing.
GetName()
gets the /Name of the person signing the document.
public virtual string GetName()
Returns
- string
name of the person signing the document.
GetReason()
Gets the /Reason value.
public virtual string GetReason()
Returns
- string
reason for signing
GetSubFilter()
A name that describes the encoding of the signature value and key information in the signature dictionary.
public virtual PdfName GetSubFilter()
Returns
- PdfName
a PdfName which usually has a value either Adbe_pkcs7_detached or ETSI_CAdES_DETACHED.
GetType()
The type of PDF object that the wrapped dictionary describes; if present, shall be Sig for a signature dictionary or DocTimeStamp for a timestamp signature dictionary.
public virtual PdfName GetType()
Returns
- PdfName
a PdfName that identifies type of the wrapped dictionary, returns null if it is not explicitly specified.
Remarks
The type of PDF object that the wrapped dictionary describes; if present, shall be Sig for a signature dictionary or DocTimeStamp for a timestamp signature dictionary. Shall be not null if it's value is DocTimeStamp . The default value is: Sig.
IsWrappedObjectMustBeIndirect()
protected override bool IsWrappedObjectMustBeIndirect()
Returns
Put(PdfName, PdfObject)
Add new key-value pair to the signature dictionary.
public virtual PdfSignature Put(PdfName key, PdfObject value)
Parameters
Returns
- PdfSignature
the same PdfSignature instance
SetByteRange(int[])
Sets the /ByteRange.
public virtual void SetByteRange(int[] range)
Parameters
range
int[]an array of pairs of integers that specifies the byte range used in the digest calculation. A pair consists of the starting byte offset and the length
SetCert(byte[])
Sets the /Cert value of this signature.
public virtual void SetCert(byte[] cert)
Parameters
cert
byte[]the byte[] representing the certificate chain
SetContact(string)
Sets the /ContactInfo value.
public virtual void SetContact(string contactInfo)
Parameters
contactInfo
stringinformation to contact the person who signed this document
SetContents(byte[])
Sets the /Contents value to the specified byte[].
public virtual void SetContents(byte[] contents)
Parameters
contents
byte[]a byte[] representing the digest
SetDate(PdfDate)
Sets the /M value.
public virtual void SetDate(PdfDate date)
Parameters
date
PdfDatetime of signing
Remarks
Sets the /M value. Should only be used if the time of signing is not available in the signature.
SetLocation(string)
Sets the /Location value.
public virtual void SetLocation(string location)
Parameters
location
stringphysical location of signing
SetName(string)
Sets the /Name of the person signing the document.
public virtual void SetName(string name)
Parameters
name
stringname of the person signing the document
SetReason(string)
Sets the /Reason value.
public virtual void SetReason(string reason)
Parameters
reason
stringreason for signing
SetSignatureCreator(string)
Sets the signature creator name in the PdfSignatureBuildProperties dictionary.
public virtual void SetSignatureCreator(string signatureCreator)
Parameters
signatureCreator
stringname of the signature creator