We are using Reporting Services and would like to know if it is possible to automatically digitally sign Excel Spreadsheets created by Apsose Cell Reporting Services?
This is required to allow customers to use the Excel feature to enable macros in digitally signed spreadsheets without have to enable for all spreadsheets.
I am afraid this feature is not available at the moment. We have created an issue with id 19176 in our Issue Tracking System. We will look into the possibility of providing this feature. This thread has been linked with the issue to update you further.
Please use the attached updated version Aspose.Cells5.1.4.6.zip. The issue has been fixed. We are now supporting 'validate & sign digital signature' on ooxml file.
Sample code: using Aspose.Cells; using Aspose.Cells.DigitalSignatures; using System.Security.Cryptography.X509Certificates;
public void testSign() { DigitalSignatureCollection dsc = new DigitalSignatureCollection(); //mykey.pfx is author's private key , "tryto" is password of private key. X509Certificate2 cert = new X509Certificate2("m:\\mykey.pfx", "tryto"); DigitalSignature ds = new DigitalSignature(cert, "helloworld", DateTime.Now); dsc.Add(ds); Workbook wb = new Workbook("m:\\test.xlsx"); wb.AddDigitalSignature(dsc); wb.Save("m:\\test.xlsx"); }
Validate file: public void testvalidateSign() { Workbook wb = new Workbook("m:\\test.xlsx"); System.Console.WriteLine(wb.IsDigitallySigned); DigitalSignatureCollection dsc = wb.GetDigitalSignature(); foreach (DigitalSignature ds in dsc) { System.Console.WriteLine(ds.Comments); System.Console.WriteLine(ds.SignTime); System.Console.WriteLine(ds.IsValid); } System.Console.ReadLine(); }
Thank you for the update, it is appreciated. However we are using Reporting Services version of Aspose.Cells. Can we used digitally signed certificates with this?
Please use the attached updated version (1.5.3.7) for Aspose.Cells for Reporting Services. Yes! The updated version supports digital signature, but supports only the XLSX and XLSM format.
Please copy Aspose.Cells.ReportingServices.dll to the following location: ${SQL Server Reporting Services installation folder}/ReportServer/Bin folder.
Please copy Aspose.Cells.ReportingServices.xml file to the following location: ${Aspose.Cells for Reporting Services installation folder}/ folder and modify it.
For digital signature, please consider the following:
There are some configure information of digital signature at Aspose.Cells. ReportingServices.XML file.
1. When the value of "DigitalSignature" is "off", Aspose.Cells.ReportingServices turn off the function of digital signature.
2. When the value of Digital Signature is "on", Aspose.Cells.ReportingServices turn on the function of digital signature.
There are four parameters in Digital signature section. The detail is as follows:
1. Reportname. The parameter can point report that need digital signature. All report use a PFX file to digital signature when the parameter is blank.
2. pfxFilename. The parameter points PFX file. The filename is full filename.
3. pfxPwd. The parameter set password. It cannot be blank.
4. purpose. The purpose of digital signature. It can blank.