Programmatically installing certificates

R

Russ

Is there a way to build a program to import certificates into IE - in
place of using the import wizard? If so, where can I find the
documentation and samples? For C++ or C# please.

Thank you, Russ
 
J

Jeremy Chapman

Some general stuff to get you started:
Use capicom. If you don't have the dlls, you should be able to find it on
the microsoft site.

It's com, so you'll be able to import it into a .NET wrapper
Create a Capicom.Store object.

To open a store of certificates:
call the Open method of the Capicom.Store object
user = CAPICOM_CURRENT_USER_STORE,
store name = "my"
open mode = CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED |
CAPICOM_STORE_OPEN_EXISTING_ONLY

To list the certificates of an open store:
do a for each on the Certificates property (Collection of certificate
objects) of the object returned from the open method
The certificate object can be inspected by using the GetInfo method on a
Certificate object
parameter = CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME will get its unique name

To import a certificate:
call the Load method of the object returned from the open method
storage type = CAPICOM_KEY_STORAGE_USER_PROTECTED

To remove a certificate
call the Remove method of the object returned from the open method
the remove method expects the subject simple name of the certificate


hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top