Hi,
I migrate functionality connected with PDF document signing from SDK 3.5 to 4.0.
Certificates in solution are created using makecert (makecert.exe –r –pe –ss my –n cn=”MyCertificate”).
My solution worked fine with SDK 3.5 but in the same code with SDK 4.0 I receive error 0x80091002 “Unknown cryptographic algorithm.”.
When I generate certificate with algorithm (sha256, sha512) other then sha1 it works. But it works too with some sha1 certificates too.
In this moment I can’t regenerate all certificates connected with this solution, so I have the problem. hav You any idea how to signe document with sha1 certificate with SDK 4.0
Regards,
Stefan
Problem with signing pdf document
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Problem with signing pdf document
Hello Stefan,
have you tried catching the piece of code that throws this error and see if you can tune it slightly so that it doesn't cause those errors any more?
Also - if you cna provide us a snippet - we should be able to check the problem in more details.
Please make sure that your serial and dev codes are NOT visible in the snippet or we will need to deactivate them.
Best,
Stefan
have you tried catching the piece of code that throws this error and see if you can tune it slightly so that it doesn't cause those errors any more?
Also - if you cna provide us a snippet - we should be able to check the problem in more details.
Please make sure that your serial and dev codes are NOT visible in the snippet or we will need to deactivate them.
Best,
Stefan
-
- User
- Posts: 3
- Joined: Thu Feb 25, 2010 7:38 am
Re: Problem with signing pdf document
This is a sample code
Code: Select all
HRESULT hr ;
PDFDocument pdf;
hr = PXCp_Init(&pdf, "", "");
hr = PXCp_ReadDocumentW(pdf, L"e:\\a.pdf", 0);
HCERTSTORE hCertStore = NULL;
PCCERT_CONTEXT pCertContext = NULL;
hCertStore = CertOpenSystemStore(NULL, L"MY");
pCertContext = CryptUIDlgSelectCertificateFromStore(
hCertStore,
NULL,
NULL,
NULL,
CRYPTUI_SELECT_LOCATION_COLUMN,
0,
NULL);
PXC_RectF sr;
sr.left = I2L(1);
sr.right = I2L(4);
sr.top = I2L(3);
sr.bottom = I2L(4);
hr = PXCp_SignDocumentW(pdf, pCertContext, 0, &sr, L"Test Reason", L"Test Location", L"Test Contact Info", L"E:\\1.jpg",
Sign_GR_Name | Sign_TX_Name | Sign_TX_Date |Sign_TX_Location | Sign_TX_Reason | Sign_TX_DName);
//hr = 0x80091002 “Unknown cryptographic algorithm.”.
hr = PXCp_WriteDocumentW(pdf, L"e:\\a123A.pdf", PXCp_CreationDisposition_Overwrite, (int)PXCp_Write_Release);
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Problem with signing pdf document
Thanks Stefan,
We will take a look at this and advise as soon as possible.
Best,
Stefan
We will take a look at this and advise as soon as possible.
Best,
Stefan
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: Problem with signing pdf document
To stefan.cacek: what OS do you use?
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 3
- Joined: Thu Feb 25, 2010 7:38 am
Re: Problem with signing pdf document
I tested it o English Windows Vista Business SP2 (x86) and Polish Window 7 SP1 (x86).
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Problem with signing pdf document
Thanks for the update Stefan Cacek,
Ivan will take a look and reply as soon as possible.
Best,
Stefan
Ivan will take a look and reply as soon as possible.
Best,
Stefan
-
- Site Admin
- Posts: 3556
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: Problem with signing pdf document
And the results are the same as on XP ?I tested it o English Windows Vista Business SP2 (x86) and Polish Window 7 SP1 (x86).
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.