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: 19.9
Syntax
public class DigitalSignature

The DigitalSignature type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCertificate Obsolete.
Returns the certificate object that was used to sign the document.
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
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString (Overrides ObjectToString.)
Examples
Shows how to validate each signature in a document and display basic information about the signature.
[C#]

// 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);
    Console.WriteLine();
}
See Also