Aspose::Words::DigitalSignatures::DigitalSignature class
Contents
[
Hide
]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.
class DigitalSignature : public System::Object
Methods
Method | Description |
---|---|
get_CertificateHolder() const | Returns the certificate holder object that contains the certificate was used to sign the document. |
get_Comments() const | Gets the signing purpose comment. |
get_IssuerName() | Returns the subject distinguished name of the certificate isuuer. |
get_IsValid() const | Returns true if this digital signature is valid and the document has not been tampered with. |
get_SignatureType() const | Gets the type of the digital signature. |
get_SignatureValue() const | Gets an array of bytes representing a signature value. |
get_SignTime() const | Gets the time the document was signed. |
get_SubjectName() | Returns the subject distinguished name of the certificate that was used to sign the document. |
GetType() const override | |
Is(const System::TypeInfo&) const override | |
ToString() const override | Returns a user-friendly string that displays the value of this object. |
static Type() |
Examples
Shows how to validate and display information about each signature in a document.
auto doc = MakeObject<Document>(MyDir + u"Digitally signed.docx");
for (const auto& signature : doc->get_DigitalSignatures())
{
std::cout << (signature->get_IsValid() ? String(u"Valid") : String(u"Invalid")) << " signature: " << std::endl;
std::cout << "\tReason:\t" << signature->get_Comments() << std::endl;
std::cout << String::Format(u"\tType:\t{0}", signature->get_SignatureType()) << std::endl;
std::cout << "\tSign time:\t" << signature->get_SignTime() << std::endl;
std::cout << "\tSubject name:\t" << signature->get_CertificateHolder()->get_Certificate()->get_SubjectName() << std::endl;
std::cout << "\tIssuer name:\t" << signature->get_CertificateHolder()->get_Certificate()->get_IssuerName()->get_Name() << std::endl;
std::cout << std::endl;
}
See Also
- Namespace Aspose::Words::DigitalSignatures
- Library Aspose.Words for C++