Table of Contents

Method GetSignatures

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

GetSignatures(string, string, CancellationToken)

Returns the digital signatures present in a PDF file: the structural facts from each signature dictionary (subfilter, claimed signing time, reason, byte ranges, certification level), without any cryptographic verification. Use PdfSignatureValidator to verify them. Empty when the document is unsigned.

public static IReadOnlyList<PdfSignatureInfo> GetSignatures(string inputPath, string password = "", CancellationToken cancellationToken = default)

Parameters

inputPath string

Path to the PDF file.

password string

Password for encrypted PDFs.

cancellationToken CancellationToken

Cancels the operation.

Returns

IReadOnlyList<PdfSignatureInfo>

Examples

foreach (var signature in PdfInfo.GetSignatures("contract.pdf"))
{
    Console.WriteLine($"{signature.SubFilter}, signed {signature.SigningTime}");
}

GetSignatures(Attachment, CancellationToken)

Returns the digital signatures present in a PDF attachment, without any cryptographic verification. Empty when the document is unsigned.

public static IReadOnlyList<PdfSignatureInfo> GetSignatures(Attachment source, CancellationToken cancellationToken = default)

Parameters

source Attachment

The source PDF attachment.

cancellationToken CancellationToken

Cancels the operation.

Returns

IReadOnlyList<PdfSignatureInfo>

GetSignatures(byte[], string, CancellationToken)

Returns the digital signatures present in an in-memory PDF, without any cryptographic verification. Empty when the document is unsigned.

public static IReadOnlyList<PdfSignatureInfo> GetSignatures(byte[] input, string password = "", CancellationToken cancellationToken = default)

Parameters

input byte[]

The PDF bytes.

password string

Password for encrypted PDFs.

cancellationToken CancellationToken

Cancels the operation.

Returns

IReadOnlyList<PdfSignatureInfo>
Share