Click or drag to resize

PdfSigner Class

Represents a signer that computes the content of a digital signature in a format specified by SignatureFormat.
Inheritance Hierarchy
SystemObject
  SautinSoft.Pdf.FormsPdfSigner

Namespace: SautinSoft.Pdf.Forms
Assembly: SautinSoft.Pdf (in SautinSoft.Pdf.dll) Version: 2024.11.26
Syntax
public class PdfSigner

The PdfSigner type exposes the following members.

Constructors
 NameDescription
Public methodPdfSigner(Object)

Initializes a new instance of the PdfSigner class with a digital ID from the specified source.

The digital ID source is either an instance of a X509Certificate2 with a private key or an instance of a CspParameters.

Public methodPdfSigner(PdfDigitalId) Initializes a new instance of the PdfSigner class with the specified digital ID.
Public methodPdfSigner(String, String)

Initializes a new instance of the PdfSigner class with a digital ID available as a file with the specified file name and the password protecting the private key.

The most common format for such files is a PKCS#12 file, which uses .pfx or .p12 file extension and is a password protected storage container for digital IDs containing the public key (Certificate) and the associated private key.

Top
Properties
 NameDescription
Public propertyApplicationName

(Optional; PDF 1.5) The name of the software module used to create the signature. When used as an entry in the data dictionary of the Filter attribute (Table 2.1), the value is the name of the signature handler. The value is normally equal to the value of the Filter attribute in the signature dictionary.

Default value: Name.

Public propertyApplicationVersion

(Optional; PDF 1.6) A text string indicating the version of the application implementation, as described by the Name attribute in this dictionary. When set by Adobe Acrobat, this entry is in the format: major.minor.micro (for example 7.0.7).

Default value: Version.

Public propertyAuthorPermission

Gets or sets the permitted actions after certifying the document with this PdfSigner.

If set to a value, then the signature created by this PdfSigner is a regular, approval signature (also known as a recipient signature).

Otherwise, the signature created by this PdfSigner is a certification signature (also known as an author signature) (PDF 1.5). A document can contain only one signature field that contains a certification signature; it shall be the first signed field in the document. It enables the author to specify what changes shall be permitted to be made to the document and what changes invalidate the author's signature. The AuthorPermission in any of the Locks shall indicate the author's specification of which changes to the document will invalidate the signature. These changes to the document shall also be prevented if the PdfSignature is referred from the AuthorSignature property. A value of None indicates that the document shall be final; that is, any changes shall invalidate the signature. The values FillForm and CommentAndFillForm shall permit modifications that are appropriate for form field or comment workflows. Setting the value to any other PdfUserAccessPermissions is not supported and throws NotSupportedException.

Default value: .

Public propertyContactInfo

Gets or sets the information provided by the signer to enable a recipient to contact the signer to verify the signature.

Default value: .

Public propertyDate

Gets or sets the time of signing.

The Date must be specified if SignatureLevel is set to PAdES_B_B or higher.

Default value: Now.

Public propertyDistinguishedName

Gets or sets the distinguished name of the person or authority signing the document.

Default value: Empty so that distinguished name is not automatically added to the signature's appearance. If set to , default value is Subject distinguished name of a certificate associated with Id.

Public propertyEstimatedSignatureContentsLength

Gets the estimated length of the Content entry (in bytes) that should be large enough to contain the entire data returned by the ComputeSignature(Stream) method.

Note  Note
This property supports the SautinSoft product infrastructure and is not intended to be used directly from your code.
Public propertyHashAlgorithm

Gets or sets the hash algorithm that hashes the bytes of the document indicated by the ByteRange and the ByteRange shall specify the complete PDF file contents (excepting the Content value).

Default value: SHA256.

Public propertyId Gets the digital ID used to sign documents. The certificate that comes with your digital ID is sent to others so that they can verify your signature.
Public propertyLocation

Gets or sets the CPU host name or physical location of the signing.

Default value: .

Public propertyName

Gets or sets the name of the person or authority signing the document.

Default value: SubjectCommonName of a certificate associated with Id.

Public propertyReason

Gets or sets the reason for the signing.

The Reason and SignaturePolicyIdentifier cannot both be specified if SignatureLevel is set to PAdES_B_B or higher.

Default value: .

Public propertyRSASignaturePadding

Gets or sets the RSA signature padding to use if signer's certificate has an 'RSA' public key.

Default value: . If signer's certificate has an 'RSA' public key, Pkcs1 is used.

Public propertySignatureFormat

Gets or sets the format of the Content that this signer produces.

The SignatureFormat must be CAdES if SignatureLevel is set to PAdES_B_B or higher.

Default value: PKCS7.

Public propertySignatureLevel

Gets or sets the level of the PDF Advanced Electronic Signature (PAdES) that signature created by this signer must satisfy.

Default value: None.

If SignatureLevel is set to:

  • PAdES_B_B or higher, then SignatureFormat must be CAdES, Date must be specified, SignaturePolicyIdentifier and Reason cannot both be specified and ValidationInfo, if specified, cannot contain any CRL or OCSP response (because this information is added to the signature as 'adbe-revocationInfoArchival' signed attribute which PAdES_B_B or higher doesn't allow).
  • PAdES_B_T or higher, then Timestamper must be specified.
  • PAdES_B_LT or higher, then check that validation data is added to the security store is not performed since that can be done only after signing finishes.
  • PAdES_B_LTA or higher, then check that validation data is added to the security store and that validation data is protected by document timestamp is not performed since that can be done only after signing finishes.
Public propertySignaturePolicyIdentifier

Gets or sets the signature policy identifier to use when creating PAdES Enhanced Explicit Policy Electronic Signature (PAdES-E-EPES and legacy PAdES-E-EPES).

The SignaturePolicyIdentifier and Reason cannot both be specified if SignatureLevel is set to PAdES_B_B or higher.

Default value: .

Public propertyTimestamper

Gets or sets the timestamper used to retrieve the TimeStampToken as specified in RFC 3161 as updated by RFC 5816 for the signature field within SignerInfo for the CMS-based Content that will be added as a unsigned attribute to the SignerInfo.

The Timestamper must be specified if SignatureLevel is set to PAdES_B_T or higher.

Default value: (no timestamp will be embedded in the signature).

Public propertyUpdateDate

Gets or sets a value indicating whether to update Date, Date and Date before the PdfDocument is saved to a PDF file.

Default value: .

Public propertyValidationInfo

Gets or sets the (potentially partial) validation-related information (certificates, certificate revocation lists and Online Certificate Status Protocol responses) that should be embedded in the signature.

The ValidationInfo cannot contain any CRL or OCSP response if SignatureLevel is set to PAdES_B_B or higher.

Default value: (only signing certificate will be embedded in the signature).

Top
Methods
 NameDescription
Public methodComputeSignature

A method called when saving the PDF file that takes the PDF file stream (without Content entry) as an input and returns the signature that will be set as the value of the Content entry.

Note  Note
This method supports the SautinSoft product infrastructure and is not intended to be used directly from your code.
Top
See Also