Digital signature exception

Stimulsoft Reports.NET discussion
luczan
Posts: 32
Joined: Wed Jan 19, 2011 3:50 am
Location: Slovakia

Digital signature exception

Post by luczan »

hi,
i'm trying to export my report to pdf with digital signature and i'm getting the exception:

Digital Signature error at step 1, code #80004005: Access is denied
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step, String message, Boolean showCode)
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step)
at Stimulsoft.Report.Export.StiPdfExportService.CreateSignature(Byte[] buf, Boolean getCertificateFromCryptoUI, String certificateID, Boolean useLocalMachineCertificates, Byte[] certificateData, String certificatePassword)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)

if my application runs as administrator (allowed only for test :( ), everything is ok /so problem is with read permission for certificates from local computer..- method Win32.CertOpenStore in StiPdfExportService/. Is there any way to give rights on this Certificates Store for a specific user or any setting in stiReport/StiPdfExportSettings to solve this issue?

regards,
marek
Last edited by luczan on Mon Jul 22, 2013 8:14 am, edited 1 time in total.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Digital signature exception: Access is denied

Post by HighAley »

Hello.
luczan wrote:i'm trying to export my report to pdf with digital signature and i'm getting the exception:

Digital Signature error at step 1, code #80004005: Access is denied
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step, String message, Boolean showCode)
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step)
at Stimulsoft.Report.Export.StiPdfExportService.CreateSignature(Byte[] buf, Boolean getCertificateFromCryptoUI, String certificateID, Boolean useLocalMachineCertificates, Byte[] certificateData, String certificatePassword)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)

if my application runs as administrator (allowed only for test :( ), everything is ok /so problem is with read permission for certificates from local computer..- method Win32.CertOpenStore in StiPdfExportService/. Is there any way to give rights on this Certificates Store for a specific user or any setting in stiReport/StiPdfExportSettings to solve this issue?
Please, check your user policy. Do you have access to the Certificates Store?

Thank you.
luczan
Posts: 32
Joined: Wed Jan 19, 2011 3:50 am
Location: Slovakia

Re: Digital signature exception: Access is denied

Post by luczan »

i checked it, but i can't set access to localMachine certificate store (only to concrete certificate).

... but after editing your code, application runs without exception:

StiPdfExportService.cs
method CreateSignature:

If (useLocalMachineCertificates)
{
//CERT_STORE_NAME = "Root";
CERT_SYSTEM_STORE = Win32.CERT_SYSTEM_STORE_LOCAL_MACHINE | Win32.CERT_STORE_READONLY_FLAG;
}

Can you tell me please how to set access to localMachine store for user without admininstrator rights?

thanks
marek
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Digital signature exception: Access is denied

Post by HighAley »

Hello.

We didn't meet such problem before. We need time to make some tests.
We will let you know about results.

Thank you.
luczan
Posts: 32
Joined: Wed Jan 19, 2011 3:50 am
Location: Slovakia

Re: Digital signature exception: Access is denied

Post by luczan »

thank you
M.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Digital signature exception: Access is denied

Post by HighAley »

Hello.

We couldn't reproduce your price, but we have added the flag.
Our next prerelease build will be available on February 1.

Thank you.
luczan
Posts: 32
Joined: Wed Jan 19, 2011 3:50 am
Location: Slovakia

Re: Digital signature exception: Access is denied

Post by luczan »

hello,
i have another problem with digital signature:

System.Exception: Digital Signature error at step 3, code #80004005: Object was not found
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step, String message, Boolean showCode)
at Stimulsoft.Report.Export.StiPdfExportService.ThrowDigitalSignError(Int32 step)
at Stimulsoft.Report.Export.StiPdfExportService.CreateSignature(Byte[] buf, Boolean getCertificateFromCryptoUI, String certificateID, Boolean useLocalMachineCertificates, Byte[] certificateData, String certificatePassword)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)

-certificate was installed to local machine

my tests:
1. certificate installed to local machine - FAILED (Digital Signature error at step 3...)
2. certificate is also installed to current user - OK
3. certificate is removed from current user (certificate is still installed to local machine) - OK

could you help me with this problem, pls?

thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Digital signature exception

Post by Alex K. »

Hello,

We made some improvements in that direction about a some month ago. Please check the latest build.

Thank you.
luczan
Posts: 32
Joined: Wed Jan 19, 2011 3:50 am
Location: Slovakia

Re: Digital signature exception

Post by luczan »

yes, i know about this improvements - http://forum.stimulsoft.com/viewtopic.php?f=8&t=36129

my Stimulsoft version: 2013.2.1605.0 - I think, this version is correct.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Digital signature exception

Post by Alex K. »

Hello,
1. certificate installed to local machine - FAILED (Digital Signature error at step 3...)
In your case the certificate is selected, but do not access to it. Please try to check the security settings.

Thank you.
Post Reply