Aspose::Cells::DigitalSignatures::DigitalSignatureCollection class

DigitalSignatureCollection class

Provides a collection of digital signatures attached to a document.

class DigitalSignatureCollection

Methods

MethodDescription
Add(const DigitalSignature& digitalSignature)Add one signature to DigitalSignatureCollection.
DigitalSignatureCollection()The constructor of DigitalSignatureCollection.
DigitalSignatureCollection(DigitalSignatureCollection_Impl* impl)Constructs from an implementation object.
DigitalSignatureCollection(const DigitalSignatureCollection& src)Copy constructor.
GetEnumerator()Get the enumerator for DigitalSignatureCollection, this enumerator allows iteration over the collection.
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const DigitalSignatureCollection& src)operator=
~DigitalSignatureCollection()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//The following example shows how to validate digital signature.
//workbook from a signed source file
Workbook signedWorkbook(u"signedFile.xlsx");
//wb.IsDigitallySigned is true when the workbook is signed already.
std::cout<<signedWorkbook.IsDigitallySigned() << std::endl;
//get digitalSignature collection from workbook
DigitalSignatureCollection existingDsc = signedWorkbook.GetDigitalSignature();
Enumerator<DigitalSignature> en = existingDsc.GetEnumerator();
while (en.MoveNext())
{
    DigitalSignature existingDs = (DigitalSignature)en.GetCurrent();
    std::cout << "existingDs.Comments : " << existingDs.GetComments().ToUtf8() << std::endl;
    Date dt = existingDs.GetSignTime();
    std::cout << "existingDs.SignTime : " << dt.year << "-" << dt.month << "-" << dt.day << " " << dt.hour << ":" << dt.minute << ":" << dt.second << std::endl;
    std::cout << "existingDs.IsValid = " << (existingDs.IsValid() ? "True" : "False") << std::endl;
}

Aspose::Cells::Cleanup();

See Also