Method GetSignatures
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
inputPathstringPath to the PDF file.
passwordstringPassword for encrypted PDFs.
cancellationTokenCancellationTokenCancels the operation.
Returns
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
sourceAttachmentThe source PDF attachment.
cancellationTokenCancellationTokenCancels the operation.
Returns
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
inputbyte[]The PDF bytes.
passwordstringPassword for encrypted PDFs.
cancellationTokenCancellationTokenCancels the operation.