PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.
Moderators:TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
I would like the code sample for Digital Signature in vb.net or vb6, thus signing and how to convert the hash text to binary in order to pass the info to the driver.
To specify binary data, you can pass them as a SAFEARRAY or BSTR.
Also, as some people has commented, there is an error in the name, sometimes DigSig and others DigiSig https://help.pdf-xchange.com/DEV/de ... natures.29
(not sure if linking help pages works)
please see the attached image
40 cd dd 28 ae 91 60 2e dd 74 e3 09 bc 5e 09 8f 84 58 77 b7
or
9D 62 47 14 C7 6F B3 A1 65 75 E2 15 04 77 9F 4A 77 F2 31 DB
and so on
Thus, 20 hex values in a string with or without blanks separators, blanks will be removed obviously.
But your Hash property "possible value" (¿DataType?) requires "BINARY"
"Hash Binary This property specifies the hash value of the certificate to be used for signing the document."
Nice if this property (or other as HashString...) would be capable to move the 40char string,
but not, then
¿how can convert/format the 20hex string to your "binary" hash property?
Right now, DigiSig.Hash can be set using SAFEARRAY or Byte BSTR (see SysAllocStringByteLen).
Your proposal to use hex string is excellent, thanks, and I will implement it in a new build.
Right now you can use byte BSTR as I mentioned above, or use save array:
Ivan - Tracker Software wrote:Right now, DigiSig.Hash can be set using SAFEARRAY or Byte BSTR (see SysAllocStringByteLen).
Your proposal to use hex string is excellent, thanks, and I will implement it in a new build.
Right now you can use byte BSTR as I mentioned above, or use save array:
¿There is any way to know if the hash passed to Digisig.Hash was successful?
I think the only way is manually open the generated pdf and look for the signature.
Using pdfXchange Editor you can see info about signature i the header, but I would like to show a error window if the pdf was not signed.
¿any event or way to know in the program if the sign was applied or not or any error?
Tracker Supp-Stefan wrote:Hello Guillermo,
I've passed this to Ivan, who will follow up a bit later (it's still the middle of the night where he is).
Regards,
Stefan
Hi Stefan,
These can be an fine improvement, along with a simple way to call with hex-string text and you made the convertion internally.
Also the way the signature is printed will be better, in a way more similar to how you sign documents using pdfXchange editor (square with border, colors, fonts...)
I finally was using sign from code but a bit spartan/plain.
put_Options will return an error (or wrapper Options will generate an exception) only when you pass the wrong type of variant. But this method does not validate the value that has been passed.
In a case of "DigiSig.Hash" if you pass a proper hash value (in either way - BSTR or SaveArray), put_Options will return S_OK without checking if there is digital certificated with such hash value.
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.
Ivan - Tracker Software wrote:put_Options will return an error (or wrapper Options will generate an exception) only when you pass the wrong type of variant. But this method does not validate the value that has been passed.
In a case of "DigiSig.Hash" if you pass a proper hash value (in either way - BSTR or SaveArray), put_Options will return S_OK without checking if there is digital certificated with such hash value.
if I understand correctly
no way to know if the document was really signed.