Click or drag to resize

PdfSignatureField Class

Represents a signature field (PDF 1.3) which is a form field that contains a digital signature (see 12.8, "Digital Signatures").
Inheritance Hierarchy
SystemObject
  SautinSoft.PdfPdfObject
    SautinSoft.Pdf.AnnotationsPdfAnnotation
      SautinSoft.Pdf.FormsPdfField
        SautinSoft.Pdf.FormsPdfSignatureField

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

The PdfSignatureField type exposes the following members.

Properties
 NameDescription
Public propertyAppearance Gets the appearance settings for this PdfSignatureField.
Public propertyFieldType Gets the Signature value.
(Overrides PdfFieldFieldType)
Public propertyLockedFields Gets or sets the set of form fields whose change invalidate the signature.
Public propertyRequired If set, the field shall have a value at the time it is exported by a submit-form action (see 12.7.5.2, "Submit-Form Action").
Public propertyValue

Gets or sets the PdfSignatureField value as an instance of the PdfSignature type.

Setting this property, Appearance gets automatically updated.

Top
Methods
 NameDescription
Public methodSetLockedFields Sets the set of form fields whose change invalidate the signature to a predefined value that represents all fields in the document.
Public methodSetLockedFields(IEnumerablePdfField) Sets the set of form fields whose change invalidate the signature to those specified in the fields.
Public methodSetLockedFields(IEnumerableString) Sets the set of form fields whose change invalidate the signature to those specified in the fieldNames.
Public methodSetLockedFields(PdfField) Sets the set of form fields whose change invalidate the signature to those specified in the fields.
Public methodSetLockedFields(String) Sets the set of form fields whose change invalidate the signature to those specified in the fieldNames.
Public methodSetLockedFields(Boolean, PdfField) Sets the set of form fields whose change invalidate the signature to either those specified in the fields (if excluded is ) or all fields except those specified in the fields (if excluded is ).
Public methodSetLockedFields(Boolean, IEnumerablePdfField) Sets the set of form fields whose change invalidate the signature to either those specified in the fields (if excluded is ) or all fields except those specified in the fields (if excluded is ).
Public methodSetLockedFields(Boolean, IEnumerableString) Sets the set of form fields whose change invalidate the signature to either those specified in the fieldNames (if excluded is ) or all fields except those specified in the fieldNames (if excluded is ).
Public methodSetLockedFields(Boolean, String) Sets the set of form fields whose change invalidate the signature to either those specified in the fieldNames (if excluded is ) or all fields except those specified in the fieldNames (if excluded is ).
Public methodSign(Object)

Initiate signing of a PDF file 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.

The name of the preferred signature handler to use when validating the signature (Filter entry) is Adobe.PPKLite, the Format of the returned PdfSignature instance is PKCS7 and the ContentsLength is set to the internally estimated size.

To finish the signing, call any of the Save. Next signing cannot be initiated before the current one is not finished.

The returned PdfSignature is set to the Value thus automatically updating the Appearance.

If your project doesn't target Windows platform, to use this method, make sure your project references NuGet package System.Security.Cryptography.Pkcs.

Note  Note
If the Value is not , then the method re-signs the PDF file directly and the Save should not be called. This behavior enables delay-sign and re-sign scenarios.
Public methodSign(PdfSigner)

Initiate signing of a PDF file using the specified PdfSigner that does the actual signing in a format specified by SignatureFormat.

The length of the signature returned by the signer must be less than EstimatedSignatureContentsLength.

The name of the preferred signature handler to use when validating the signature (Filter entry) is Adobe.PPKLite, the Format of the returned PdfSignature instance is SignatureFormat and the ContentsLength is EstimatedSignatureContentsLength bytes.

To finish the signing, call any of the Save. Next signing cannot be initiated before the current one is not finished.

The returned PdfSignature is set to the Value thus automatically updating the Appearance.

Note  Note
If the Value is not , then the method re-signs the PDF file directly and the Save should not be called. This behavior enables delay-sign and re-sign scenarios.
Public methodSign(String, String)

Initiate signing of a PDF file 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.

The name of the preferred signature handler to use when validating the signature (Filter entry) is Adobe.PPKLite, the Format of the returned PdfSignature instance is PKCS7 and the ContentsLength is set to the internally estimated size.

To finish the signing, call any of the Save. Next signing cannot be initiated before the current one is not finished.

The returned PdfSignature is set to the Value thus automatically updating the Appearance.

If your project doesn't target Windows platform, to use this method, make sure your project references NuGet package System.Security.Cryptography.Pkcs.

Note  Note
If the Value is not , then the method re-signs the PDF file directly and the Save should not be called. This behavior enables delay-sign and re-sign scenarios.
Public methodSign(FuncStream, Byte, PdfSignatureFormat, Int32)

Initiate signing of a PDF file using the specified delegate that does the actual signing in a format specified by signatureFormat.

The length of the signature returned by the signer delegate must be less than estimatedSignatureContentsLength.

The name of the preferred signature handler to use when validating the signature (Filter entry) is Adobe.PPKLite, the Format of the returned PdfSignature instance is signatureFormat and the ContentsLength is estimatedSignatureContentsLength bytes.

To finish the signing, call any of the Save. Next signing cannot be initiated before the current one is not finished.

The returned PdfSignature is set to the Value thus automatically updating the Appearance.

Note  Note
If the Value is not , then the method re-signs the PDF file directly and the Save should not be called. This behavior enables delay-sign and re-sign scenarios.
Public methodTimestamp

Initiate timestamping of a PDF file using the specified PdfTimestamper that does the actual timestamping.

The length of the timestamp token returned by the timestamper must be less than EstimatedTimestampTokenLength.

The name of the preferred signature handler to use when validating the signature (Filter entry) is Adobe.PPKLite, the Format of the returned PdfSignature instance is RFC3161 and the ContentsLength is EstimatedTimestampTokenLength bytes.

To finish the timestamping, call any of the Save. Next signing or timestamping cannot be initiated before the current one is not finished.

Top
Extension Methods
 NameDescription
Public Extension MethodGetArray Gets the PdfArray that serves as a backing storage of the specified PdfObject or if no PdfArray serves as a backing storage of the specified PdfObject.
(Defined by PdfObjectExtensions)
Public Extension MethodGetDictionary Gets the PdfDictionary that serves as a backing storage of the specified PdfObject.
(Defined by PdfObjectExtensions)
Public Extension MethodGetOrAddDictionary Gets the PdfDictionary that serves as a backing storage of the specified PdfObject.
(Defined by PdfObjectExtensions)
Top
See Also