CreateCS C Library Reference

CreateCS

Factory class for creating certificate store objects.

This class is specific to the Windows operating system, and therefore is only available on Windows systems.

Create/Dispose

HCkCreateCS CkCreateCS_Create(void);

Creates an instance of the CkCreateCS object and returns a handle (i.e. a "void *" pointer). The handle is passed in the 1st argument for the functions listed on this page.

void CkCreateCS_Dispose(HCkCreateCS handle);

Objects created by calling CkCreateCS_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

C "Properties"

void CkCreateCS_getLastErrorHtml(HCkCreateCS cHandle, HCkString retval);

Error information in HTML format for the last method called.

void CkCreateCS_getLastErrorText(HCkCreateCS cHandle, HCkString retval);

Error information in plain-text format for the last method called.

void CkCreateCS_getLastErrorXml(HCkCreateCS cHandle, HCkString retval);

Error information in XML format for the last method called.

BOOL CkCreateCS_getReadOnly(HCkCreateCS cHandle);
void CkCreateCS_putReadOnly(HCkCreateCS cHandle, BOOL newVal);

Determines whether certificate stores are opened with read-only or read/write permissions. Only applies to methods such as OpenCurrentUserStore, where the a readOnly parameter is not present.

BOOL CkCreateCS_getUtf8(HCkCreateCS cHandle);
void CkCreateCS_putUtf8(HCkCreateCS cHandle, BOOL newVal);

When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.

void CkCreateCS_getVersion(HCkCreateCS cHandle, HCkString retval);

The version of this component, such as "1.0"

C "Methods"

HCkCertStore CkCreateCS_CreateFileStore(HCkCreateCS cHandle, const char *filename);

Creates a file-based certificate store. If 'filename' already exists, the method will fail.

HCkCertStore CkCreateCS_CreateMemoryStore(HCkCreateCS cHandle);

Creates a temporary certificate store in memory that is initially empty.

HCkCertStore CkCreateCS_CreateRegistryStore(HCkCreateCS cHandle, const char *regRoot, const char *regPath);

Creates a registry-based certificate store. The 'hiveName' can either be "CurrentUser" or "LocalMachine". The 'regPath' argument should be specified without a leading slash, such as "Software/Chilkat/MyCertStore".

HCkCertStore CkCreateCS_OpenChilkatStore(HCkCreateCS cHandle);

Opens the certificate store used by Chilkat Mail and returns the object representing that store.

HCkCertStore CkCreateCS_OpenCurrentUserStore(HCkCreateCS cHandle);

Opens the local system's Current User Certificate Store and returns the object representing that store.

HCkCertStore CkCreateCS_OpenFileStore(HCkCreateCS cHandle, const char *filename);

Opens an existing file certificate store. To open it read-only, readOnly should be non-zero.

HCkCertStore CkCreateCS_OpenLocalSystemStore(HCkCreateCS cHandle);

Opens the local system's Local Machine Certificate Store and returns the object representing that store.

HCkCertStore CkCreateCS_OpenOutlookStore(HCkCreateCS cHandle);

Opens the certificate store used by Microsoft Outlook (and Office) and returns the object representing that store.

HCkCertStore CkCreateCS_OpenRegistryStore(HCkCreateCS cHandle, const char *regRoot, const char *regPath);

Opens an existing registry-based certificate store. 'hiveName' should be either "CurrentUser" or "LocalMachine". The 'regPath' argument should be specified without a leading slash, such as "Software/Chilkat/MyCertStore".

BOOL CkCreateCS_SaveLastError(HCkCreateCS cHandle, const char *filename);

Saves the last error information to an XML formatted file.

const char *CkCreateCS_lastErrorHtml(HCkCreateCS cHandle);

Error information in HTML format for the last method called.

Returns a null on failure

const char *CkCreateCS_lastErrorText(HCkCreateCS cHandle);

Error information in plain-text format for the last method called.

Returns a null on failure

const char *CkCreateCS_lastErrorXml(HCkCreateCS cHandle);

Error information in XML format for the last method called.

Returns a null on failure