Open Certificate Store CertSvc

Open Certificate Store CertSvc

Post by crypto » Fri, 19 Aug 2005 18:47:20


Hi,

I have installed Certificate Services on a Win2K machine. Its a
stand-alone CA. I need to renew a certificate in that CA. For that I
need to open the certificate store and find the specific certificate.

The name of my Certificate Service is "CertSvcCA". I am opening the
Certificate Store using the following code.

hCertStore = CertOpenStore( CERT_STORE_PROV_SYSTEM,
0,
NULL,
CERT_SYSTEM_STORE_SERVICES | CERT_STORE_OPEN_EXISTING_FLAG |
CERT_STORE_READONLY_FLAG,
L"remmachine.add.com\\CertSvcCA" );

After that I try to search for any certificate in the store using

pEnrollmentCert = CertFindCertificateInStore( hCertStore,
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
0,
CERT_FIND_ANY,
NULL, NULL );

But pEnrollmentCert is always returned as NULL.

If I open the Certificate Store (CertOpenStore) using any of the
following strings
L"remmachine.add.com\\CA"
L"remmachine.add.com\\Root"
L"remmachine.add.com\\My"
Then pEnrollmentCert is NOT NULL and I can view the certificate.

How can I open the Store of the Certificate Services which I have
installed i.e. of "CertSvcCA"?

Please help,

Thanks and Regards,
-crypton.
 
 
 

Open Certificate Store CertSvc

Post by crypto » Fri, 19 Aug 2005 19:50:34

I found that The "CertSvc" service stores the certificates in a file,
with the name of the service "CertSvcCA.edb" in
"C:\WINNT\system32\CertLog".

used in CertOpenStore looks for the following key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Services
When I checked the registry on the Win2k machine I found that there is
nothing under this key.

How can this certificate store which is used by the Certificate
Services installed on Win2K be opened ?
Please help !!!