We have faced with error with creation of XAdES digital signature in code – passing
X509Certificate2 combined with XAdES signature type throws an exception
Steps to reproduce :
- Try create digital signature instance with
X509Certificate2, not passing row data with password
- Set the signature type to XAdES
Exception is thrown:
Aspose.Cells.CellsException: Please use ‘DigitalSignature(byte rawData, string password, string comments, DateTime signTime)’ constructor to instance DigitalSignature object.
at Aspose.Cells.DigitalSignatures.DigitalSignature.set_XAdESType(XAdESType value)
at DCError.Program.Main() in C:\Users\alexander.zolotarev\source\repos\DCError\DCError\Program 185697 2.cs:line 27
- Program.cs – the example of the code for conversion
Cert .pfx – the certificate for signing
content.zip (3.2 KB)
Please, note, we are using:
Aspose.Cell v. 126.96.36.199
Could you please advise us with the current behavior? Or could you please advise us on another way to initialize the digital signature, for example, from the Windows Store?