DigitalSignature Class

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

ExpandedInheritance Hierarchy

SystemObject
  Aspose.Words.DigitalSignaturesDigitalSignature

Namespace:  Aspose.Words.DigitalSignatures
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 22.1.0

ExpandedSyntax

public class DigitalSignature

The DigitalSignature type exposes the following members.

ExpandedProperties

  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.

ExpandedMethods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a user-friendly string that displays the value of this object.
(Overrides ObjectToString.)

ExpandedExamples

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();
}

ExpandedSee Also