Table of Contents

Class PdfSigningOptions

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

Options controlling PdfSigner.

public sealed class PdfSigningOptions
Inheritance
PdfSigningOptions
Inherited Members

Examples

var options = new PdfSigningOptions
{
    Certificate = signerCertificateWithPrivateKey,
    Reason = "Approved",
};

PdfSigner.Sign("contract.pdf", "contract-signed.pdf", options);

Properties

AdditionalCertificates

Certificates embedded alongside the signer so validators can build the chain: typically the issuing CA(s). The trust root itself need not ship.

Appearance

The visible field's appearance. null composes an automatic one from the signer and signing time; assign None to keep a visible field empty. Ignored for invisible signatures (no Bounds) and for document timestamps.

AppearanceCulture

The language of the automatic appearance text ("Digitally signed by", "Date:", "Reason:"). null follows the current UI culture. A language whose script the built-in Helvetica cannot carry (Cyrillic, CJK, Arabic, Devanagari) composes in English unless FontFile supplies a font that can render it.

Bounds

The widget rectangle in page coordinates, or null for an invisible signature. A visible field renders Appearance (or, when that is null, an automatic appearance: the signer's common name, the signing time, and the reason).

Certificate

The signer certificate. One-call signing requires its private key (any BCL provider works, non-exportable store and hardware keys included); BeginSign(byte[], PdfSigningOptions, CancellationToken) needs no certificate because the caller produces the CMS container.

Certification

Makes this the document's certification (author) signature with the given DocMDP permission, declaring which later changes are allowed. Default: None, an ordinary approval signature. A document carries at most one certification signature, and it must be the first one applied.

FieldName

The partial field name of the new signature field. Must be unique in the document.

Format

The signature container format. Default: PadesDetached.

PageIndex

Zero-based index of the page carrying the signature field. Default: 0.

Password

Password used to open the document when it is encrypted.

Reason

The reason for signing recorded in the signature dictionary, or null for none.

SignatureCapacity

Bytes reserved for the DER CMS container. The default fits a typical signature with its chain and a timestamp; raise it when embedding long chains. Range: 256 to 65536.

SigningTime

The claimed signing time recorded in the dictionary's /M entry. null uses the current UTC time. To make the time cryptographically proven rather than claimed, add an RFC 3161 timestamp (a later milestone).

TimestampAuthority

An RFC 3161 timestamp authority to attest the signature (PAdES B-T): the authority proves the signing time instead of the signer claiming it. null signs without a timestamp. Ignored when TimestampTokenProvider is set.

TimestampTokenProvider

Custom timestamp source: receives the SHA-256 digest of the signature value and returns the DER-encoded RFC 3161 token. Use it when the authority is reached through something other than plain HTTP (an internal service, a proxy, a test authority). Takes precedence over TimestampAuthority.

Share