iText 9.0.0 API
iText.Signatures.PdfSignature Class Reference

Represents the signature dictionary. More...

Inheritance diagram for iText.Signatures.PdfSignature:
iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >

Public Member Functions

  PdfSignature ()
  Creates new PdfSignature. More...
 
  PdfSignature (PdfName filter, PdfName subFilter)
  Creates new PdfSignature. More...
 
  PdfSignature (PdfDictionary sigDictionary)
  Creates new PdfSignature instance from the provided iText.Kernel.Pdf.PdfDictionary. More...
 
virtual PdfName  GetSubFilter ()
  A name that describes the encoding of the signature value and key information in the signature dictionary. More...
 
virtual PdfName  GetType ()
  The type of PDF object that the wrapped dictionary describes; if present, shall be iText.Kernel.Pdf.PdfName.Sig for a signature dictionary or iText.Kernel.Pdf.PdfName.DocTimeStamp for a timestamp signature dictionary. More...
 
virtual void  SetByteRange (int[] range)
  Sets the /ByteRange. More...
 
virtual PdfArray  GetByteRange ()
  Gets the /ByteRange. More...
 
virtual void  SetContents (byte[] contents)
  Sets the /Contents value to the specified byte[]. More...
 
virtual PdfString  GetContents ()
  Gets the /Contents entry value. More...
 
virtual void  SetCert (byte[] cert)
  Sets the /Cert value of this signature. More...
 
virtual PdfString  GetCert ()
  Gets the /Cert entry value of this signature. More...
 
virtual PdfObject  GetCertObject ()
  Gets the /Cert entry value of this signature. More...
 
virtual void  SetName (String name)
  Sets the /Name of the person signing the document. More...
 
virtual String  GetName ()
  gets the /Name of the person signing the document. More...
 
virtual void  SetDate (PdfDate date)
  Sets the /M value. More...
 
virtual PdfString  GetDate ()
  Gets the /M value. More...
 
virtual void  SetLocation (String location)
  Sets the /Location value. More...
 
virtual String  GetLocation ()
  Gets the /Location entry value. More...
 
virtual void  SetReason (String reason)
  Sets the /Reason value. More...
 
virtual String  GetReason ()
  Gets the /Reason value. More...
 
virtual void  SetSignatureCreator (String signatureCreator)
  Sets the signature creator name in the PdfSignatureBuildProperties dictionary. More...
 
virtual void  SetContact (String contactInfo)
  Sets the /ContactInfo value. More...
 
virtual iText.Signatures.PdfSignature  Put (PdfName key, PdfObject value)
  Add new key-value pair to the signature dictionary. More...
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
virtual T  GetPdfObject ()
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  SetModified ()
 
virtual void  Flush ()
 
virtual bool  IsFlushed ()
 

Protected Member Functions

override bool  IsWrappedObjectMustBeIndirect ()
  Defines if the object behind this wrapper must be an indirect object in the resultant document. More...
 

Additional Inherited Members

- Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
  PdfObjectWrapper (T pdfObject)
 
virtual void  SetPdfObject (T pdfObject)
 
virtual void  SetForbidRelease ()
 
virtual void  UnsetForbidRelease ()
 
virtual void  EnsureUnderlyingObjectHasIndirectReference ()
 
- Static Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
static void  MarkObjectAsIndirect (PdfObject pdfObject)
 
static void  EnsureObjectIsAddedToDocument (PdfObject @object)
  Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to. More...
 

Detailed Description

Represents the signature dictionary.

Constructor & Destructor Documentation

◆ PdfSignature() [1/3]

iText.Signatures.PdfSignature.PdfSignature ( )
inline

Creates new PdfSignature.

◆ PdfSignature() [2/3]

iText.Signatures.PdfSignature.PdfSignature ( PdfName  filter,
PdfName  subFilter 
)
inline

Creates new PdfSignature.

Parameters
filter PdfName of the signature handler to use when validating this signature
subFilter PdfName that describes the encoding of the signature

◆ PdfSignature() [3/3]

iText.Signatures.PdfSignature.PdfSignature ( PdfDictionary  sigDictionary )
inline

Creates new PdfSignature instance from the provided iText.Kernel.Pdf.PdfDictionary.

Parameters
sigDictionary

iText.Kernel.Pdf.PdfDictionary to create new PdfSignature instance from

Member Function Documentation

◆ GetByteRange()

virtual PdfArray iText.Signatures.PdfSignature.GetByteRange ( )
inlinevirtual

Gets the /ByteRange.

Returns
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()

virtual PdfString iText.Signatures.PdfSignature.GetCert ( )
inlinevirtual

Gets the /Cert entry value of this signature.

Gets the /Cert entry value of this signature. See ISO 32000-1 12.8.1, Table 252 – Entries in a signature dictionary.

Returns
the signature cert

◆ GetCertObject()

virtual PdfObject iText.Signatures.PdfSignature.GetCertObject ( )
inlinevirtual

Gets the /Cert entry value of this signature.

Gets the /Cert entry value of this signature. /Cert entry required when SubFilter is adbe.x509.rsa_sha1. May be array or byte string.

Returns
the signature cert value

◆ GetContents()

virtual PdfString iText.Signatures.PdfSignature.GetContents ( )
inlinevirtual

Gets the /Contents entry value.

Gets the /Contents entry value. See ISO 32000-1 12.8.1, Table 252 – Entries in a signature dictionary.

Returns
the signature content

◆ GetDate()

virtual PdfString iText.Signatures.PdfSignature.GetDate ( )
inlinevirtual

Gets the /M value.

Gets the /M value. Should only be used if the time of signing is not available in the signature.

Returns

iText.Kernel.Pdf.PdfString which denotes time of signing.

◆ GetLocation()

virtual String iText.Signatures.PdfSignature.GetLocation ( )
inlinevirtual

Gets the /Location entry value.

Returns
physical location of signing.

◆ GetName()

virtual String iText.Signatures.PdfSignature.GetName ( )
inlinevirtual

gets the /Name of the person signing the document.

Returns
name of the person signing the document.

◆ GetReason()

virtual String iText.Signatures.PdfSignature.GetReason ( )
inlinevirtual

Gets the /Reason value.

Returns
reason for signing

◆ GetSubFilter()

virtual PdfName iText.Signatures.PdfSignature.GetSubFilter ( )
inlinevirtual

A name that describes the encoding of the signature value and key information in the signature dictionary.

Returns
a iText.Kernel.Pdf.PdfName which usually has a value either iText.Kernel.Pdf.PdfName.Adbe_pkcs7_detached or iText.Kernel.Pdf.PdfName.ETSI_CAdES_DETACHED.

◆ GetType()

virtual PdfName iText.Signatures.PdfSignature.GetType ( )
inlinevirtual

The type of PDF object that the wrapped dictionary describes; if present, shall be iText.Kernel.Pdf.PdfName.Sig for a signature dictionary or iText.Kernel.Pdf.PdfName.DocTimeStamp for a timestamp signature dictionary.

The type of PDF object that the wrapped dictionary describes; if present, shall be iText.Kernel.Pdf.PdfName.Sig for a signature dictionary or iText.Kernel.Pdf.PdfName.DocTimeStamp for a timestamp signature dictionary. Shall be not null if it's value is iText.Kernel.Pdf.PdfName.DocTimeStamp . The default value is: iText.Kernel.Pdf.PdfName.Sig.

Returns
a iText.Kernel.Pdf.PdfName that identifies type of the wrapped dictionary, returns null if it is not explicitly specified.

◆ IsWrappedObjectMustBeIndirect()

override bool iText.Signatures.PdfSignature.IsWrappedObjectMustBeIndirect ( )
inlineprotectedvirtual

Defines if the object behind this wrapper must be an indirect object in the resultant document.

Returns

Defines if the object behind this wrapper must be an indirect object in the resultant document.

Implements iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.

◆ Put()

virtual iText.Signatures.PdfSignature iText.Signatures.PdfSignature.Put ( PdfName  key,
PdfObject  value 
)
inlinevirtual

Add new key-value pair to the signature dictionary.

Parameters
key

iText.Kernel.Pdf.PdfName to be added as a key

Parameters
value

iText.Kernel.Pdf.PdfObject to be added as a value

Returns
the same PdfSignature instance

◆ SetByteRange()

virtual void iText.Signatures.PdfSignature.SetByteRange ( int[]  range )
inlinevirtual

Sets the /ByteRange.

Parameters
range 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()

virtual void iText.Signatures.PdfSignature.SetCert ( byte[]  cert )
inlinevirtual

Sets the /Cert value of this signature.

Parameters
cert the byte[] representing the certificate chain

◆ SetContact()

virtual void iText.Signatures.PdfSignature.SetContact ( String  contactInfo )
inlinevirtual

Sets the /ContactInfo value.

Parameters
contactInfo information to contact the person who signed this document

◆ SetContents()

virtual void iText.Signatures.PdfSignature.SetContents ( byte[]  contents )
inlinevirtual

Sets the /Contents value to the specified byte[].

Parameters
contents a byte[] representing the digest

◆ SetDate()

virtual void iText.Signatures.PdfSignature.SetDate ( PdfDate  date )
inlinevirtual

Sets the /M value.

Sets the /M value. Should only be used if the time of signing is not available in the signature.

Parameters
date time of signing

◆ SetLocation()

virtual void iText.Signatures.PdfSignature.SetLocation ( String  location )
inlinevirtual

Sets the /Location value.

Parameters
location physical location of signing

◆ SetName()

virtual void iText.Signatures.PdfSignature.SetName ( String  name )
inlinevirtual

Sets the /Name of the person signing the document.

Parameters
name name of the person signing the document

◆ SetReason()

virtual void iText.Signatures.PdfSignature.SetReason ( String  reason )
inlinevirtual

Sets the /Reason value.

Parameters
reason reason for signing

◆ SetSignatureCreator()

virtual void iText.Signatures.PdfSignature.SetSignatureCreator ( String  signatureCreator )
inlinevirtual

Sets the signature creator name in the PdfSignatureBuildProperties dictionary.

Parameters
signatureCreator name of the signature creator