Archive: Import digital certificate


Import digital certificate
Hi,

Saw one post on this a couple of years ago - is there any way to import a root certificate as part of an installation? My "pet app" is code signed by an internal CA and the root cert for that ca needs to be imported for the app to work correctly.

Any thoughts?

Thanks...:igor:


IMHO

Write a plugin for NSIS via Delphi (see examples of how to do just that) with the help of buying the source of the following

http://www.eldos.com/sbb/desc-pki-features.php

In the worst case you can look in the souce and try to do this by useing NSIS System command, but then you must be reeeeeaaaly persistant to get it working ;)


Yeah, I'm simply not that talented....but I did get it to work using the CAPICOM dll, a sample vbscript that comes in the CAPICOM SDK, and the basic modern UI example so all is well.

Thanks again...;)


Hey ewallig
Can you please give me the code to install the certificate please
Thanks in advance


Hi,

you need the following files

- CAPICOM.dll
- The vbscript file that MSOFT provides for the procedure

Both of these files can be obtained from Microsoft but if you need to, send an email to ilinktech@yahoo.com and I'll get them out to you. As far as the NSIS code, see the attached file.

The installer checks for and if necessary installs / registers CAPICOM, copies the files to a TEMP folder, executes the script which imports the cert. Once the cert is imported, it unregisters and removes CAPICOM (security purposes) and then deletes the temp files.

No real error checking built in but I'm sure that it can be improved on. It works 100% of the time for me so I didn't add anything else to it.

Hope this helps,

- Ed