Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 1.43 KB

CertOpenSystemStore.md

File metadata and controls

67 lines (46 loc) · 1.43 KB

Home

Function name : CertOpenSystemStore

Group: Cryptography Reference - Library: crypt32


This is a simplified function that opens the most common system certificate store.


Declaration:

HCERTSTORE WINAPI CertOpenSystemStore(
	HCRYPTPROV_LEGACY hprov,
	LPTCSTR szSubsystemProtocol
);  

FoxPro declaration:

DECLARE INTEGER CertOpenSystemStore IN crypt32;
	INTEGER hprov,;
	STRING szSubsystemProtocol  

Parameters:

hprov [in] This parameter is not used and should be set to NULL.

szSubsystemProtocol [in] A string that names a system store (CA, MY, ROOT, SPC).


Return value:

If the function succeeds, the function returns a handle to the certificate store.


Comments:

If the system store name provided in szSubsystemProtocol parameter is not the name of an existing system store, a new system store will be created and used.

After use, the store should be closed by using CertCloseStore.

#DEFINE CERT_CLOSE_STORE_FORCE_FLAG 1  
#DEFINE CERT_CLOSE_STORE_CHECK_FLAG 2  
  
LOCAL hStore  
hStore = CertOpenSystemStore(0, "CA")  
? "Cert.store handle:", hStore  
  
IF hStore = 0  
	? "Error:", GetLastError()  
ELSE  
	= CertCloseStore(hStore, 0)  
ENDIF