DigitalSignature Class

Represents a digital signature on a document and the result of its verification.

Inheritance Hierarchy

SystemObject
  Aspose.WordsDigitalSignature

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.9.0

Syntax

public class DigitalSignature

The DigitalSignature type exposes the following members.

Properties

  NameDescription
Public propertyCode exampleCertificateHolder
Returns the certificate holder object that contains the certificate was used to sign the document.
Public propertyCode exampleComments
Gets the signing purpose comment.
Public propertyCode exampleIssuerName
Returns the subject distinguished name of the certificate isuuer.
Public propertyCode exampleIsValid
Returns true if this digital signature is valid and the document has not been tampered with.
Public propertyCode exampleSignatureType
Gets the type of the digital signature.
Public propertyCode exampleSignTime
Gets the time the document was signed.
Public propertyCode exampleSubjectName
Returns the subject distinguished name of the certificate that was used to sign the document.

Methods

  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString
Returns a user-friendly string that displays the value of this object.
(Overrides ObjectToString.)

Examples

Shows how to validate and display information about each signature in a document.
Document doc = new Document(MyDir + "Digitally signed.docx");

foreach (DigitalSignature signature in doc.DigitalSignatures)
{
    Console.WriteLine($"{(signature.IsValid ? "Valid" : "Invalid")} signature: ");
    Console.WriteLine($"\tReason:\t{signature.Comments}"); 
    Console.WriteLine($"\tType:\t{signature.SignatureType}");
    Console.WriteLine($"\tSign time:\t{signature.SignTime}");
    Console.WriteLine($"\tSubject name:\t{signature.CertificateHolder.Certificate.SubjectName}");
    Console.WriteLine($"\tIssuer name:\t{signature.CertificateHolder.Certificate.IssuerName.Name}");
    Console.WriteLine();
}

See Also