PdfSignatureInfo Class

A signature of a document, as PdfSignatureVerifier found and checked it: the integrity of the bytes it covers, the cryptographic signature, the time stamp and the information of the signature dictionary.

public sealed class PdfSignatureInfo

Remarks

The verification does not decide whether the signer is trusted: build the chain of PdfSignatureInfo.Certificate with X509Chain and the trust anchors and revocation policy of the application.

Properties

NameDescription
AreModificationsPermittedGets a value indicating whether the PdfSignatureInfo.Modifications are allowed by the certification level and the field lock of the signature. Without certification and lock, every change is allowed: check PdfSignatureInfo.CoversWholeDocument.
ByteRangesGets the byte ranges of the file the signature covers: offsets and lengths.
CertificateGets the certificate of the signer, or of the time stamp authority of a document time stamp.
CertificatesGets the certificates the signature embeds.
CertificationLevelGets the changes the signature allows after it when it is a certification signature (DocMDP), or null.
ContactInfoGets the contact information of the signer (/ContactInfo).
CoversWholeDocumentGets a value indicating whether the signature covers the whole file: no revision was appended after it.
ErrorGets the reason the signature could not be checked, or null.
FieldLockGets the fields the signature locks (FieldMDP), or null.
FieldNameGets the fully qualified name of the signature field.
IsDocumentIntactGets a value indicating whether the bytes the signature covers are those that were signed: their digest matches.
IsDocumentTimestampGets a value indicating whether the signature is a document time stamp (ETSI.RFC3161), not the signature of a person.
IsSignatureValidGets a value indicating whether the cryptographic signature is valid for the certificate of the signer.
IsSigningCertificateValidGets a value indicating whether the ESS signing certificate attribute (RFC 5035) identifies PdfSignatureInfo.Certificate: null when the signature has no such attribute and its format does not require it. A PAdES signature (ETSI.CAdES.detached) requires it.
IsTimestampValidGets a value indicating whether the time stamps are valid, all of them: null for a signature without time stamp.
IsValidGets a value indicating whether the signature is valid: intact, cryptographically valid, with a valid time stamp when it has one, an ESS signing certificate that identifies the certificate of the signer when it has one, and no change after it that its certification or its field lock forbids.
LocationGets the place of the signature (/Location).
ModificationsGets the objects the revisions appended after the signature added or changed; empty when the signature covers the whole document. It is a summary of the changes for the application to review, built from the structure of the document, not a proof that the document shows the same content.
ReasonGets the reason of the signature (/Reason).
SignerNameGets the name of the signer (/Name), as it was signed.
SigningTimeGets the time of the signature the signer claims (/M): it is not proven, unlike PdfSignatureInfo.TimestampTime.
SubFilterGets the format of the signature (/SubFilter): ETSI.CAdES.detached, adbe.pkcs7.detached, adbe.pkcs7.sha1 or ETSI.RFC3161.
TimestampTimeGets the time of the time stamp of the signature (PAdES B-T), the earliest valid one when it has several, or of a document time stamp.

AreModificationsPermitted

PdfSignatureInfo.cs

Gets a value indicating whether the PdfSignatureInfo.Modifications are allowed by the certification level and the field lock of the signature. Without certification and lock, every change is allowed: check PdfSignatureInfo.CoversWholeDocument.

public bool AreModificationsPermitted { get; }

Property value

bool

Gets the byte ranges of the file the signature covers: offsets and lengths.

public IReadOnlyList<(long Offset, long Length)> ByteRanges { get; }

Gets the certificate of the signer, or of the time stamp authority of a document time stamp.

public X509Certificate2? Certificate { get; }

Property value

X509Certificate2?

Gets the certificates the signature embeds.

public X509Certificate2Collection Certificates { get; }

CertificationLevel

PdfSignatureInfo.cs

Gets the changes the signature allows after it when it is a certification signature (DocMDP), or null.

public PdfCertificationLevel? CertificationLevel { get; }

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

public string? ContactInfo { get; }

Property value

string?

CoversWholeDocument

PdfSignatureInfo.cs

Gets a value indicating whether the signature covers the whole file: no revision was appended after it.

public bool CoversWholeDocument { get; }

Property value

bool

Gets the reason the signature could not be checked, or null.

public string? Error { get; }

Property value

string?

Gets the fields the signature locks (FieldMDP), or null.

public PdfFieldLock? FieldLock { get; }

Property value

PdfFieldLock?

Gets the fully qualified name of the signature field.

public string FieldName { get; }

Property value

string

IsDocumentIntact

PdfSignatureInfo.cs

Gets a value indicating whether the bytes the signature covers are those that were signed: their digest matches.

public bool IsDocumentIntact { get; }

Property value

bool

IsDocumentTimestamp

PdfSignatureInfo.cs

Gets a value indicating whether the signature is a document time stamp (ETSI.RFC3161), not the signature of a person.

public bool IsDocumentTimestamp { get; }

Property value

bool

IsSignatureValid

PdfSignatureInfo.cs

Gets a value indicating whether the cryptographic signature is valid for the certificate of the signer.

public bool IsSignatureValid { get; }

Property value

bool

IsSigningCertificateValid

PdfSignatureInfo.cs

Gets a value indicating whether the ESS signing certificate attribute (RFC 5035) identifies PdfSignatureInfo.Certificate: null when the signature has no such attribute and its format does not require it. A PAdES signature (ETSI.CAdES.detached) requires it.

public bool? IsSigningCertificateValid { get; }

Property value

bool?

IsTimestampValid

PdfSignatureInfo.cs

Gets a value indicating whether the time stamps are valid, all of them: null for a signature without time stamp.

public bool? IsTimestampValid { get; }

Property value

bool?

Gets a value indicating whether the signature is valid: intact, cryptographically valid, with a valid time stamp when it has one, an ESS signing certificate that identifies the certificate of the signer when it has one, and no change after it that its certification or its field lock forbids.

public bool IsValid { get; }

Property value

bool

Gets the place of the signature (/Location).

public string? Location { get; }

Property value

string?

Modifications

PdfSignatureInfo.cs

Gets the objects the revisions appended after the signature added or changed; empty when the signature covers the whole document. It is a summary of the changes for the application to review, built from the structure of the document, not a proof that the document shows the same content.

public IReadOnlyList<PdfModification> Modifications { get; }

Gets the reason of the signature (/Reason).

public string? Reason { get; }

Property value

string?

Gets the name of the signer (/Name), as it was signed.

public string? SignerName { get; }

Property value

string?

Gets the time of the signature the signer claims (/M): it is not proven, unlike PdfSignatureInfo.TimestampTime.

public DateTimeOffset? SigningTime { get; }

Property value

DateTimeOffset?

Gets the format of the signature (/SubFilter): ETSI.CAdES.detached, adbe.pkcs7.detached, adbe.pkcs7.sha1 or ETSI.RFC3161.

public string? SubFilter { get; }

Property value

string?

TimestampTime

PdfSignatureInfo.cs

Gets the time of the time stamp of the signature (PAdES B-T), the earliest valid one when it has several, or of a document time stamp.

public DateTimeOffset? TimestampTime { get; }

Property value

DateTimeOffset?