Error in digital signing

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
tomywu
Posts: 13
Joined: Fri Jul 04 2008

Error in digital signing

Post by tomywu »

Hi

I would like to apply PDF converter with the digital signing features using PowerBuilder.
I used a standard .p12 certificate for the digital signing and the certificate worked well with digisign_test.exe. However, upon signing the pdf file, I encountered the following signature error in pdf. Please help. Thanks.


Error in PDF
Signature is invalid:
There are errors in the formatting or information contained in this signature (Unexpected byte range values defining scope of signed data.)
Signer's identity has not yet been verified


Code
boolean result1
// create the new ole object.
doc1 = create oleobject

// Connect the doc1 ole object to the cdintf interface of CDIntf.dll
doc1.ConnectToNewObject("cdintfEx.document")

doc1.SetLicenseKey("LicenseTo", "ActivationCode")

// Open the pdf file to which the Passwords shall be added
doc1.Open ("C:\test.pdf")

// Digital signing
result1 = doc1.DigitalSignature ("TestCert", "Approved", "C:\test.jpg", "Hong Kong", 1, 100, 100, 400, 300, 1 + 2 + 4 + 8)

// save the opened document.
doc1.Save ("C:\test_sgined.pdf")

// Destroy doc1 object
Destroy doc1
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: Error in digital signing

Post by Joan »

Hello,

Which version of the PDF Converter are you using?
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
tomywu
Posts: 13
Joined: Fri Jul 04 2008

Re: Error in digital signing

Post by tomywu »

Hi,

The PDF Converter version is the most updated one - v3.0.2.

Please Tell me if you need more information.
David
Amyuni Team
Posts: 89
Joined: Mon Dec 18 2006

Re: Error in digital signing

Post by David »

Hello

The Amyuni PDF Converter's Digital Signatures option uses the Microsoft signature handler (PPKMS digital signatures types) and these digital certificates must be stored in the "My" or "Personal" store. Along with this, the digital certificates must also have the appropriate "Key Usage". The "Key Usage" option indicates what the digital certificate can be used for.

You will need to check that:

1 - Your Digital Signature is valid for signing documents. This is indicated in the properties of the certificate under "Key usage"

2 - The Digital Signature type should be of PPKMS digital signature type

3 - The Digital certificate is stored in the "My" or "Personal" store

4 - In your sample code are you passing the correct license and activation code to the SetLicenseKey()?

Hope that helps?
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php
tomywu
Posts: 13
Joined: Fri Jul 04 2008

Re: Error in digital signing

Post by tomywu »

Hi,

1) Yes. My cert is valid for signing documents under "key usage"
3) Yes. My Digital cert is stored in Personal store
4) The license and activiation code should be valid as I've used the same one and can generate a pdf correctly.

2) I am not sure how to generate/verify my certificate with digital signature type. Can anyone help?

Thanks!
tomywu
Posts: 13
Joined: Fri Jul 04 2008

Re: Error in digital signing

Post by tomywu »

For your information, I can sign the pdf successfully without error using the same digital certificate with Adobe Acrobat software
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: Error in digital signing

Post by Joan »

Hello,

I suspect that you might be using an old version of the Converter or maybe some old dlls are stuck in memeory.

Please open the pdf file you are generating in Adobe and check what is the PDF Producer of this file.

Thanks
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
tomywu
Posts: 13
Joined: Fri Jul 04 2008

Re: Error in digital signing

Post by tomywu »

Hi,

I have tried to install the Amyuni PDF Converter v3.02 in plain new PC and got the same error. So I think the problem should not be caused by an old version of PDF Converter. And the PDF properties is showing "Amyuni PDF Conerter version 3.02" too.

Do you have any idea? Or may I know if you have any small application for digital signing that I can run in local to see whether my PC setting and digital certificate are working fine?

Thanks for your help.
Post Reply