Class DigitalSignatureCollection
Class DigitalSignatureCollection
Namespace: Aspose.Cells.DigitalSignatures
Assembly: Aspose.Cells.dll (25.2.0)
Provides a collection of digital signatures attached to a document.
public class DigitalSignatureCollection : IEnumerable
Inheritance
object ← DigitalSignatureCollection
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
The following example shows how to validate digital signature.
//workbook from a signed source file
Workbook signedWorkbook = new Workbook(@"signedFile.xlsx");
//wb.IsDigitallySigned is true when the workbook is signed already.
Console.WriteLine(signedWorkbook.IsDigitallySigned);
//get digitalSignature collection from workbook
DigitalSignatureCollection existingDsc = signedWorkbook.GetDigitalSignature();
foreach (DigitalSignature existingDs in existingDsc)
{
Console.WriteLine(existingDs.Comments);
Console.WriteLine(existingDs.SignTime);
Console.WriteLine(existingDs.IsValid);
}
'workbook from a signed source file
Dim signedWorkbook As Workbook = New Workbook("newfile.xlsx")
'Workbook.IsDigitallySigned is true when the workbook is signed already.
Console.WriteLine(signedWorkbook.IsDigitallySigned)
'get digitalSignature collection from workbook
Dim existingDsc As DigitalSignatureCollection = signedWorkbook.GetDigitalSignature()
Dim existingDs As DigitalSignature
For Each existingDs In existingDsc
Console.WriteLine(existingDs.Comments)
Console.WriteLine(existingDs.SignTime)
Console.WriteLine(existingDs.IsValid)
Next
Constructors
DigitalSignatureCollection()
The constructor of DigitalSignatureCollection.
public DigitalSignatureCollection()
Methods
Add(DigitalSignature)
Add one signature to DigitalSignatureCollection.
public void Add(DigitalSignature digitalSignature)
Parameters
digitalSignature
DigitalSignature
Digital signature in collection.
GetEnumerator()
Get the enumerator for DigitalSignatureCollection, this enumerator allows iteration over the collection
public IEnumerator GetEnumerator()
Returns
The enumerator to iteration.