Table of Contents

Class PdfSignatureOptions

Namespace
MiPdf.Signatures
Assembly
MiPdf.dll

Options for PdfSigner.

public sealed class PdfSignatureOptions
Inheritance
PdfSignatureOptions
Inherited Members

Properties

AdditionalSignedAttributes

Additional signed CMS attributes (e.g. encrypted biometric data under a private OID). They are covered by the signature. Example: new AsnEncodedData("1.3.6.1.4.1.32473.1.1", derOctetString).

public IList<AsnEncodedData> AdditionalSignedAttributes { get; }

Property Value

IList<AsnEncodedData>

AdditionalUnsignedAttributes

Additional unsigned CMS attributes.

public IList<AsnEncodedData> AdditionalUnsignedAttributes { get; }

Property Value

IList<AsnEncodedData>

Appearance

Appearance of a visible signature (used when Rectangle is set).

public PdfSignatureAppearance Appearance { get; set; }

Property Value

PdfSignatureAppearance

Certification

Makes this a certification (author) signature with the given DocMDP permissions.

public CertificationLevel? Certification { get; set; }

Property Value

CertificationLevel?

ContactInfo

Contact information of the signer (/ContactInfo); also available as {contact} in the appearance text.

public string? ContactInfo { get; set; }

Property Value

string

DigestAlgorithm

Hash algorithm for the document digest and the signature (default SHA-256).

public HashAlgorithmName DigestAlgorithm { get; set; }

Property Value

HashAlgorithmName

FieldLock

Form fields locked by this signature (FieldMDP), e.g. PdfFieldLock.Include("name", "date"). A later change of a locked field invalidates the signature. If null, a lock defined on the signature field (Lock) is applied. Can be combined with Certification.

public PdfFieldLock? FieldLock { get; set; }

Property Value

PdfFieldLock

FieldName

Name of the signature field. An existing empty signature field is used; otherwise a new one is created.

public string? FieldName { get; set; }

Property Value

string

Format

Format of the signature container (default PAdES).

public PdfSignatureFormat Format { get; set; }

Property Value

PdfSignatureFormat

Location

Location of signing (/Location), e.g. a city; also available as {location} in the appearance text.

public string? Location { get; set; }

Property Value

string

PageNumber

1-based page for a new visible signature field.

public int PageNumber { get; set; }

Property Value

int

Password

Password for encrypted documents.

public string? Password { get; set; }

Property Value

string

Reason

Reason for signing (/Reason), e.g. "Approval"; also available as {reason} in the appearance text.

public string? Reason { get; set; }

Property Value

string

Rectangle

Position of a new signature field; null or empty = invisible signature.

public PdfRectangle? Rectangle { get; set; }

Property Value

PdfRectangle?

RepairDamagedDocument

Sign documents that had to be repaired when opening: they are saved completely first (only possible if the document contains no signatures yet). Default false: such documents are rejected.

public bool RepairDamagedDocument { get; set; }

Property Value

bool

RsaPadding

Signature padding for RSA keys: Pkcs1 (PKCS#1 v1.5, default) or Pss (RSASSA-PSS with MGF1 over DigestAlgorithm and a salt as long as the digest). Ignored for ECDSA keys. External signers must implement SignHash(byte[], HashAlgorithmName, RSASignaturePadding) for PSS.

public RSASignaturePadding RsaPadding { get; set; }

Property Value

RSASignaturePadding

SignatureCreator

Name of the signing application written to /Prop_Build /App /Name (default "miPDFlib").

public string SignatureCreator { get; set; }

Property Value

string

SignatureDictionaryEntries

Additional entries written into the signature dictionary (/V of the field), e.g. application data such as "/Biometrics". Keys are PDF names without slash. The entries are covered by the signature (they lie inside the signed byte range). Strings can be added with new PdfString(text).

public IDictionary<string, PdfObject> SignatureDictionaryEntries { get; }

Property Value

IDictionary<string, PdfObject>

SignatureSize

Reserved size of the signature container in bytes; 0 = estimate automatically.

public int SignatureSize { get; set; }

Property Value

int

SignerName

Signer name shown in viewers (/Name); default: common name of the certificate.

public string? SignerName { get; set; }

Property Value

string

SigningTime

Claimed signing time (/M). Default: now.

public DateTimeOffset? SigningTime { get; set; }

Property Value

DateTimeOffset?

TimestampClient

Time-stamp authority for a signature time-stamp (PAdES B-T).

public ITimestampClient? TimestampClient { get; set; }

Property Value

ITimestampClient

TimestampOptional

If the time-stamp authority fails, sign without time-stamp (level B-B) instead of throwing. SignDetailed(byte[], IExternalSigner, PdfSignatureOptions?) reports the reached level.

public bool TimestampOptional { get; set; }

Property Value

bool