I can generate a driver test page with a digital signature if I set it up manually in the PDF-XChange Printer 2012 driver properties dialog using a System stored certificate. However, I cannot get it to work via the driver API.
I tried adding the following lines to the CExAPI sample program:
Code: Select all
printer->Option[L"DigiSig.Enabled"] = L"True"; printer->Option[L"DigiSig.Store"] = L"System"; printer->Option[L"DigiSig.Reason"] = L"Sample Reason"; printer->Option[L"DigiSig.Location"] = L"Sample Location"; printer->Option[L"DigiSig.Contact"] = L"Sample Contact"; printer->Option[L"DigiSig.ShowFlags"] = 63;
Note that I didn't specify the DigiSig.Hash, as I wasn't sure which hash algorithm to use or what form it should take (this is the only instance of a Binary property in the entire driver API.) In any case, I'm guessing/hoping that it would use the first cert as the default. If this could be the problem, can you please provide an example of how to get and specify the hash of a system cert?
I also tried using a Certificate stored in a PFX file (the same one I use for code signing). In that case, whether I do it manually/interactively through the driver dialog properties and test page, or through the API using the sample application, the result is the same: it goes through the motions, asks to save the file, but doesn't actually create any file. I know the password is correct because it works with signtool.exe. (I realize that to create a signature that Adobe recognizes as valid, I may need to use one of their approved cert providers, but at this point I just need to verify the the basic operation can work.)
I searched through all the forum articles but could not find one that covered digital signatures via the driver API.
Thanks in advance for any assistance on this,