PdfSignatureOptions Class

The options of a signature: the certificate, the information of the signature dictionary and the time stamp of PAdES B-T.

public sealed class PdfSignatureOptions

Constructors

NameDescription
PdfSignatureOptions(X509Certificate2)Initializes a new instance of the PdfSignatureOptions class.

PdfSignatureOptions(X509Certificate2)

PdfSignatureOptions.cs

Initializes a new instance of the PdfSignatureOptions class.

public PdfSignatureOptions(X509Certificate2 certificate)

Parameters

certificate X509Certificate2
The certificate of the signer, with its private key (RSA or ECDSA).

Properties

NameDescription
AppearanceGets the widget of a visible signature; null (the default) for an invisible signature on the first page.
CertificateGets the certificate of the signer.
CertificatesGets the other certificates of the chain of the signer, which the signature embeds so that it can be validated.
CertificationGets the changes the signature allows after it, for a certification signature (ISO 32000-2, 12.8.2.2, DocMDP); null (the default) for an approval signature. A certification signature is the first signature of a document.
ContactInfoGets the contact information of the signer (/ContactInfo).
FieldLockGets the fields the signature locks (ISO 32000-2, 12.8.2.4, FieldMDP); null (the default) for the lock of the signature field when it has one, or no lock.
FieldNameGets the name of the signature field. The default is Signature followed by the first number not used. An existing signature field that is not signed yet is signed; the name of any other field cannot be used.
HashAlgorithmGets the digest algorithm. The default is SHA-256.
HttpClientGets the client the time stamp requests are sent with; null for a client of the library.
LocationGets the place of the signature (/Location).
ReasonGets the reason of the signature (/Reason), such as "I approve this document".
ReservedSizeGets the bytes reserved for the signature in the file; 0 (the default) for a size computed from the certificates and the time stamp.
RsaSignaturePaddingGets the padding of an RSA signature: RSASignaturePadding.Pkcs1 or RSASignaturePadding.Pss (RSASSA-PSS with MGF1 and a salt of the length of the digest, RFC 4055). null (the default) is PKCS #1 v1.5; it must be null for an ECDSA key.
SignerNameGets the name of the signer (/Name), when it is not the name of the certificate.
SigningTimeGets the time of the signature the signer claims (/M). The default is the current time.
TimestampAuthorityGets the URL of the RFC 3161 time stamp authority that stamps the signature, for PAdES B-T; null (the default) for PAdES B-B, a signature without time stamp.

Gets the widget of a visible signature; null (the default) for an invisible signature on the first page.

public PdfSignatureAppearance? Appearance { get; init; }

Gets the certificate of the signer.

public X509Certificate2 Certificate { get; }

Property value

X509Certificate2

Gets the other certificates of the chain of the signer, which the signature embeds so that it can be validated.

public X509Certificate2Collection Certificates { get; }

Gets the changes the signature allows after it, for a certification signature (ISO 32000-2, 12.8.2.2, DocMDP); null (the default) for an approval signature. A certification signature is the first signature of a document.

public PdfCertificationLevel? Certification { get; init; }

Gets the contact information of the signer (/ContactInfo).

public string? ContactInfo { get; init; }

Property value

string?

Gets the fields the signature locks (ISO 32000-2, 12.8.2.4, FieldMDP); null (the default) for the lock of the signature field when it has one, or no lock.

public PdfFieldLock? FieldLock { get; init; }

Property value

PdfFieldLock?

Gets the name of the signature field. The default is Signature followed by the first number not used. An existing signature field that is not signed yet is signed; the name of any other field cannot be used.

public string? FieldName { get; init; }

Property value

string?

Gets the digest algorithm. The default is SHA-256.

public HashAlgorithmName HashAlgorithm { get; init; }

Property value

HashAlgorithmName

Gets the client the time stamp requests are sent with; null for a client of the library.

public HttpClient? HttpClient { get; init; }

Property value

HttpClient?

Gets the place of the signature (/Location).

public string? Location { get; init; }

Property value

string?

Gets the reason of the signature (/Reason), such as "I approve this document".

public string? Reason { get; init; }

Property value

string?

Gets the bytes reserved for the signature in the file; 0 (the default) for a size computed from the certificates and the time stamp.

public int ReservedSize { get; init; }

Property value

int

RsaSignaturePadding

PdfSignatureOptions.cs

Gets the padding of an RSA signature: RSASignaturePadding.Pkcs1 or RSASignaturePadding.Pss (RSASSA-PSS with MGF1 and a salt of the length of the digest, RFC 4055). null (the default) is PKCS #1 v1.5; it must be null for an ECDSA key.

public RSASignaturePadding? RsaSignaturePadding { get; init; }

Property value

RSASignaturePadding?

Gets the name of the signer (/Name), when it is not the name of the certificate.

public string? SignerName { get; init; }

Property value

string?

Gets the time of the signature the signer claims (/M). The default is the current time.

public DateTimeOffset? SigningTime { get; init; }

Property value

DateTimeOffset?

TimestampAuthority

PdfSignatureOptions.cs

Gets the URL of the RFC 3161 time stamp authority that stamps the signature, for PAdES B-T; null (the default) for PAdES B-B, a signature without time stamp.

public Uri? TimestampAuthority { get; init; }

Property value

Uri?