DigitalSignature class
DigitalSignature class
Represents a digital signature on a document and the result of its verification. To learn more, visit the Work with Digital Signatures documentation article.
Properties
Name | Description |
---|---|
certificateHolder | Returns the certificate holder object that contains the certificate was used to sign the document. |
comments | Gets the signing purpose comment. |
isValid | Returns true if this digital signature is valid and the document has not been tampered with. |
issuerName | Returns the subject distinguished name of the certificate isuuer. |
signTime | Gets the time the document was signed. |
signatureType | Gets the type of the digital signature. |
signatureValue | Gets an array of bytes representing a signature value. |
subjectName | Returns the subject distinguished name of the certificate that was used to sign the document. |
Examples
Shows how to validate and display information about each signature in a document.
const doc = new aw.Document(base.myDir + "Digitally signed.docx");
for (var i = 0; i < doc.digitalSignatures.count; i++) {
const signature = doc.digitalSignatures.at(i);
console.log(`${signature.isValid ? "Valid" : "Invalid"} signature: `);
console.log(`\tReason:\t${signature.comments}`);
console.log(`\tType:\t${signature.signatureType}`);
console.log(`\tSign time:\t${signature.signTime}`);
console.log(`\r\n`);
}
See Also
- module Aspose.Words