Signing PDFs

Discussions about PDF management.
Post Reply
EFernkaes
Posts: 36
Joined: Fri Jul 31, 2015 5:27 pm

Signing PDFs

Post by EFernkaes » Mon Sep 28, 2015 4:20 pm

Hello Orpalis team,

we have a question and a Problem:

Q: Is there a way to change the standard Icon for the .DigiSignWithStamp method?
The used icon consisting of an head with a question mark always brings up to these questions "Why is there a question mark? Does this mean the user wasn't found? Is the signature valid when there is a question mark?"
By the way, the little black borders of the head makes it much difficult, to read the overlayd text.

P: We are running a IIS7 webserver on a 64-bit machine under Windows Server 2008 SP1.
We created a little application, where the user can examine scanned .jpg-images. After validating the content, the user should be able to sign a PDF-file containing these images.
Everything works fine so far, we create the PDF-file from the scanned Images on the fly. But when trying to apply the .DigiSignWithStamp or .DigiSign method, we get an "Internal Error" of the System.Security.Cryptography assembly.

I've compiled your sample applicatione "Digital Signing PDF" and could run it as an .exe from this webserver without any problems. Of course I used the same certificate and signing Image and paramters.
Both, the asp.net application and the sample application uses .net Framework 3.5.

Do you have an hint?
Thank you for your efforts in advance.

Erwin

Here the error text:
[CryptographicException: Interner Fehler.]
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) +33
System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) +0
System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags) +203
System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password) +131
gdpicture_ឹ.gdpicture_ᜀ(Stream A_0, String A_1) +220
gdpicture_។.gdpicture_ᜁ(Stream A_0, String A_1) +33
gdpicture_។.gdpicture_ᜅ(String A_0, String A_1) +74
GdPicture11.GdPicturePDF.DigiSign(String DstPDFPath, String CertPath, String Password, String Reason, String Location, String ContactInfo, String SignerName, Boolean Linearize, PdfSignatureMode SignatureMode) +80
GdPicture11.GdPicturePDF.DigiSign(String DstPDFPath, String CertPath, String Password, String Reason, String Location, String ContactInfo, String SignerName, Boolean Linearize) +33
GdPicture11.GdPicturePDF.DigiSign(String DstPDFPath, String CertPath, String Password, String Reason, String Location, String ContactInfo, String SignerName) +28
ASP.clearingportal_boschtt_pdfsigning_signing_user_aspx.cmdSend_Click(Object sender, EventArgs e) in D:\Daten\Intranet.SSL\ClearingPortal-BOSCHTT\PDFSigning\Signing_User.aspx:186
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Here the code:

Code: Select all

        m_GdPicturePDF.LoadFromFile(tmpPDFFile, False)
        tmpPDFFile = "\\NAS1\Scannen\BOSCH\Thermotechnik\Signed.pdf")

        m_GdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch)
        m_GdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)

        'status = m_GdPicturePDF.DigiSignWithStamp(tmpPDFFile, WritePath &"\Certificate_User00001.pfx", "XXXX", txtSigReason.Text, txtSigOrt.Text, lblAbteilung.Text, lblSignierer.Text, stampResName, 2.5, 1.5, 2, 0.7, True)
        status = m_GdPicturePDF.DigiSign(tmpPDFFile, WritePath &"\Certificate_User00001.pfx", "XXXX", txtSigReason.Text, txtSigOrt.Text, lblAbteilung.Text, lblSignierer.Text)
        m_GdPicturePDF.CloseDocument()

delbeke
Posts: 89
Joined: Wed Oct 31, 2012 5:07 pm

A

Post by delbeke » Tue Sep 29, 2015 11:32 am

Hi EFernkaes,

The icon is known as validation mark. Its aspects depends on the digital certificate validation.
A green check means that the certificate has been well verified.
A yellow question mark means that the viewer did not manage to validate the certificate.
A red cross reveals a problem in the part of the pdf protected by the signature.

This icon is optional, there is a parameter in DigiSignWithStamp allowing to add the mark or not.
The drawing of this mark is not in the pdf, but it is generated by the viewer. So it's aspect relies on the viewer.

For the problem, do you use our last release ?
If yes, please, give us a small project reproducing the problem. You can share it with our team through https://www.gdpicture.com/support/getting-support-from-our-team

Jean-Luc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests