CertStoreOpen Function

CertStoreOpen Function

Secure Home | Search | About
 Microsoft Applications Security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content add this group's latest topics to your Google content
Subject Author Date
CertStoreOpen Function Wilayat 07-22-2008
Posted by Wilayat on July 22, 2008, 5:32 pm
If you were  Registered and logged in, you could reply and use other advanced thread options
Hello to all friends!

I am using an example program in MS Visual C++ taken from MSDN at
http://msdn.microsoft.com/en-us/library/aa382372(VS.85).aspx. I
created a certificate using

makecert -n "CN=Test" -sk Test -ss my Test.cer

This created a store 'my' and a Test.cer file. i see 'Test.cer' there
in ...\vc\bin folder. I could not find any store with the name 'my'.
now when i executed the code below (complete program is at the above
link),

[CODE]
......
#define SIGNER_NAME L"Test"
......
#define CERT_STORE_NAME L"my"
......
if ( !( hCertStore = CertOpenStore(
CERT_STORE_PROV_SYSTEM,
0,
NULL,
CERT_SYSTEM_STORE_CURRENT_USER,
CERT_STORE_NAME)))
{
MyHandleError(TEXT("The MY store could not be opened."));
goto exit_SignMessage;
}

// Get a pointer to the signer's certificate.
// This certificate must have access to the signer's private key.
if(pSignerCert = CertFindCertificateInStore(
hCertStore,
MY_ENCODING_TYPE,
0,
CERT_FIND_SUBJECT_STR,
SIGNER_NAME,
NULL))
{
_tprintf(TEXT("The signer's certificate was found.\n"));
}
else
{
MyHandleError( TEXT("Signer certificate not found."));
goto exit_SignMessage;
}
[/CODE]

it give error "Singer Certificate not found". Can any body help me
how to solve this problem? The 'my' certificate store, is not visible.
can I open the store in some editor etc to see the certificate? Or how
to create a store then?

regards,
wilayat


The site map in XML format XML site map

Contact Us | Privacy Policy