CertOpenStore访问被拒绝

时间:2014-02-05 17:00:04

标签: c++ certificate

我在c ++中有一些代码从商店获得证书:

// Open CA system store
m_hCertStore = ::CertOpenStore(
    CERT_STORE_PROV_SYSTEM, 
    0,
    NULL, 
    CERT_SYSTEM_STORE_CURRENT_USER,
   //CERT_SYSTEM_STORE_LOCAL_MACHINE,
    Store
);

if( !m_hCertStore )
    throw MY_WIN32_TO_HRESULT(GetLastError());

// Locate "iScala License Key Generator" certificate
m_pCCertContext = ::CertFindCertificateInStore(
    m_hCertStore, 
    PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, 
    0, 
    CERT_FIND_SUBJECT_STR, 
    CertSubject, 
    NULL
);

当它尝试打开证书存储区时,我收到拒绝访问错误。

证书位于证书/当前用户,中级证书颁发机构。

0 个答案:

没有答案