views:

92

answers:

0

Hello,

I have installed a certificate with Subject "UW008" in the MY store (CERT_SYSTEM_STORE_CURRENT_USER). When i run my test application, logged in as an Administrator, my test application is able to find the certificate with the corresponding subject ID.

When i tried to access the same application from across a network(with same admin access) I my application failed to get the certificate.

GetCertFromStore(unsigned char* vSubject)

{

// Call CertOpenStore to open the MY store.
if((hSystemStore = CertOpenStore(
      CERT_STORE_PROV_SYSTEM,
      0,
      NULL,
      CERT_SYSTEM_STORE_CURRENT_USER,
      L"MY")) != NULL)
{    // Get a particular certificate using CertFindCertificateInStore.
    if((pTargetCert = CertFindCertificateInStore(
        hSystemStore,           // Store handle.
        MY_ENCODING_TYPE,       // Encoding type.
        0,                      // Not used.
        CERT_FIND_SUBJECT_STR_A,// Find type. Find a string in the
           // certificate's subject.
        vSubject,               // The string to be searched for.
        pTargetCert)) != NULL)  // Previous context.
    {
               //Get the cert handle and proceed
   }
 }
}
  1. Should i have to use the CERT_SYSTEM_STORE_LOCAL_MACHINE instead? Even if i use this then i need to install the certificates in the system store right?

  2. What do you mean by system store, logical store and physical store? How are they related?

  3. What is the use of this function CertRegisterPhysicalStore ?

Please help me to understand these concepts. Thank you