Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Digital Signature |
Post Reply |
Author | |
DigitalSignature
Beginner Joined: 20 Jan 21 Status: Offline Points: 12 |
Post Options
Thanks(0)
Posted: 20 Jan 21 at 8:40AM |
Hi, my application is in C/C++ for Windows platform & I want to use Quick PDF library to
generate multi-lingual PDFs that are digitally signed using one of the certificates on system. I'm unable to get any documentation on how would one use Quick PDF library to digitally sign a PDF using a certificate from store. All I've got until now is SetSignProcessCertFromStore method from the documents, but there is no sample code on how do I go about using it. Any documentation or samples or guide on this would be really helpful.
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(1)
|
I have not used a certificate from the Windows store, but I have used a certificate from a PFX file. Basically you start a Sign Process with qp.NewSignProcessFromX, where X is 'file' or 'stream' or 'string' containing the PDF. This function returns a sign process ID which is required in all subsequent signing calls. Then if you want a picture stamp, you may need to use SetSignProcessField, SetSignProcessFieldBounds, SetSignProcessFieldImageFromFile, and then you may need QP.SetNeedAppearances(0). Next, SetSignProcessSubFilter and SetSignProcessInfo if you need them. Finally I use SetSignProcessPFXFromFile to load the certificate, but you would replace this with SetSignProcessCertFromStore. To save the signed PDF you call EndSignProcessToFile(id, outputpdffile) and qp.GetSignProcessResult. Make sure that you use a certificate which supports PDF-signing. Not all do. And it is essential to check, report and fix any error returns from the above functions, before continuing to the next one. It does all work, but there is a lot to get right. Persevere!
|
|
DigitalSignature
Beginner Joined: 20 Jan 21 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
@tfrost That was really helpful, thank you. Will try this out and get back if I run into any issue.
|
|
DigitalSignature
Beginner Joined: 20 Jan 21 Status: Offline Points: 12 |
Post Options
Thanks(1)
|
@tfrost It worked! Thanks a lot. For others who would have a similar requirement to sign PDF using windows store certificate the process is as follows : 1) Start a signing intent with NewSignProcessFromXXX & use SignProcessID returned by this method on all API calls below 2) Get SHA1 hash of the certificate and call SetSignProcessCertFromStore 3) Specify signature field on PDF using SetSignProcessField, if you don't have one, it'll create it for you 4) Call EndSignProcessToXXX to sign PDF 5) GetSignProcessResult can be used to verify if PDF was signed successfully
|
|
mLipok
Senior Member Joined: 23 Apr 14 Location: Poland, Zabrze Status: Offline Points: 453 |
Post Options
Thanks(0)
|
maybe here:
https://developers.foxitsoftware.com/kb/article/advanced-options-signing-pdf-files/ btw. Somebody can provide how to modify this example to use CryptCards ? |
|
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store