CryptCATOpen function

[The CryptCATOpen function is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The CryptCATOpen function opens a catalog and returns a context handle to the open catalog.

Note  Some older versions of Wintrust.lib do not contain the export information for this function. In this case, you must use the LoadLibrary and GetProcAddress functions to dynamically link to Wintrust.dll.
 

Syntax

HANDLE CryptCATOpen(
  LPWSTR        pwszFileName,
  IN DWORD      fdwOpenFlags,
  IN HCRYPTPROV hProv,
  IN DWORD      dwPublicVersion,
  IN DWORD      dwEncodingType
);

Parameters

pwszFileName

A pointer to a null-terminated string for the catalog file name.

fdwOpenFlags

Zero, to open an existing catalog file, or a bitwise combination of one or more of the following values.

Value Meaning
CRYPTCAT_OPEN_ALWAYS
Opens the file, if it exists, or creates a new file, if needed.
CRYPTCAT_OPEN_CREATENEW
A new catalog file is created. If a previously created file exists, it is overwritten.

hProv

A handle to a cryptographic service provider (CSP).

dwPublicVersion

Version of the file. This can be one of the following values.

Value Meaning
CRYPTCAT_VERSION_1
0x100
Version 1 file format.
CRYPTCAT_VERSION_2
0x200
Version 2 file format.

Windows 8 and Windows Server 2012:  Support for this value begins.

dwEncodingType

Encoding type used for the file. If this value is 0, then the encoding type is set to PKCS_7_ASN_ENCODING | X509_ASN_ENCODING.

Return Value

Upon success, this function returns a handle to the open catalog. When you have finished using the handle, close it by calling the CryptCATClose function. The CryptCATOpen function returns INVALID_HANDLE_VALUE if it fails.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header mscat.h
Library Wintrust.lib
DLL Wintrust.dll

See Also

CryptCATClose