DocumentDigitalSignatures Property
Gets the collection of digital signatures for this document and their validation results.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public DigitalSignatureCollection DigitalSignatures { get; }

Property Value

Type: DigitalSignatureCollection

This collection contains digital signatures that were loaded from the original document. These digital signatures will not be saved when you save this Document object into a file or stream because saving or converting will produce a document that is different from the original and the original digital signatures will no longer be valid.

This collection is never null. If the document is not signed, it will contain zero elements.

Shows how to validate all signatures in a document.
// Load the signed document
Document doc = new Document(MyDir + "Document.DigitalSignature.docx");
DigitalSignatureCollection digitalSignatureCollection = doc.DigitalSignatures;

if (digitalSignatureCollection.IsValid)
    Console.WriteLine("Signatures belonging to this document are valid");
    Console.WriteLine("Signatures belonging to this document are NOT valid");
Shows how to validate each signature in a document and display basic information about the signature.
// Load the document which contains signature
Document doc = new Document(MyDir + "Document.DigitalSignature.docx");

foreach (DigitalSignature signature in doc.DigitalSignatures)
    Console.WriteLine("*** Signature Found ***");
    Console.WriteLine("Is valid: " + signature.IsValid);
    Console.WriteLine("Reason for signing: " +
                      signature.Comments); // This property is available in MS Word documents only
    Console.WriteLine("Signature type: " + signature.SignatureType);
    Console.WriteLine("Time of signing: " + signature.SignTime);
    Console.WriteLine("Subject name: " + signature.CertificateHolder.Certificate.SubjectName);
    Console.WriteLine("Issuer name: " + signature.CertificateHolder.Certificate.IssuerName.Name);
See Also