RSA Security logo

RSA BSAFE Cert-C
API Reference

capiprov.h File Reference

This file is the header file used to implement a CryptoAPI database service provider for Cert-C.

For more information, see the Cert-C CryptoAPI Database Service Provider page.

#include "certc.h"

Go to the source code of this file.

Data Structures

struct  MS_CAPI_DB_PARAMS
 Use the MS_CAPI_DB_PARAMS structure to pass initialization parameters to the Cert-C CryptoAPI Database service provider's initialization functions. More...


Functions

int S_InitializeCryptoAPIDB (CERTC_CTX pCtx, POINTER pParams, SERVICE_FUNCS *pFuncs, POINTER *ppHandle)
 Never call the S_InitializeCryptoAPIDB() function directly. More...


Function Documentation

int S_InitializeCryptoAPIDB CERTC_CTX    pCtx,
POINTER    pParams,
SERVICE_FUNCS   pFuncs,
POINTER *    ppHandle
;
 

Never call the S_InitializeCryptoAPIDB() function directly. To initialize or register the Cert-C CryptoAPI Database service provider, call the C_InitializeCertC() or C_RegisterService() function. Both functions take SERVICE_HANDLER and a POINTER to a parameters structure as parameters. SERVICE_HANDLER's Initialize parameter points to the S_InitializeCryptoAPIDB() function, and the corresponding POINTER must point to an MS_CAPI_DB_PARAMS structure.

Cert-C uses S_InitializeCryptoAPIDB() to initialize the Cert-C CryptoAPI Database service provider's functions and initialization parameters. S_InitializeCryptoAPIDB() stores pointers to the Cert-C CryptoAPI Database service provider's functions in funcs's db member, which is a DB_FUNCS structure. S_InitializeCryptoAPIDB() uses the Cert-C CryptoAPI Database service provider's initialization parameters in params, which points to an MS_CAPI_DB_PARAMS structure.

This function opens a CryptoAPI system certificate store (which can also contain CRLs), and returns a handle to that database in the Cert-C CryptoAPI Database Service Provider's ppHandle parameter.

If a private key is exportable from CryptoAPI it will be reformatted as a Crypto-C B_KEY_OBJ of the appropriate type (KI_RSA_CRT) for use with Crypto-C. If a private key is non-exportable and does not have this property, a reference to it will be formatted in a B_KEY_OBJ of type KI_Token. Any subsequent Crypto-C APIs using this key will in turn call back into CAPI to perform the operation. The Cert-C session chooser for Crypto-C includes a BHAPI module that translates operations with the KI_Token key object into CryptoAPI calls using the appropriate key container and key type.

Parameters:
pCtx This input parameter points to an initialized Cert-C context handle.
pParams This input parameter points to a type MS_CAPI_DB_PARAMS structure that contains the Cert-C CryptoAPI Database service provider's initialization parameters.
pFuncs This is both an input and output parameter. As an input parameter, it points to an allocated but uninitialized SERVICE_FUNCS union. As an output parameter, it points to the initialized Cert-C CryptoAPI Database service provider-specific functions in SERVICE_FUNCS's db member, which is a DB_FUNCS structure.
ppHandle This output parameter points to this instance of the Cert-C CryptoAPI Database service provider's handle.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.



RSA BSAFE® Cert-C 2.7 API Reference