RSA Security logo

RSA BSAFE Cert-C
API Reference

rsadb.h File Reference

This file defines the public interface to a Cert-C SPI, the default database service provider interface.

#include "service.h"

Go to the source code of this file.

Data Structures

struct  DEFAULT_DB_PARAMS
 Passes initialization parameters to the Cert-C Default Database service provider initialization functions. More...


Functions

int S_InitializeDefaultDB (POINTER ctx, POINTER params, SERVICE_FUNCS *funcs, POINTER *handle)
 Never call the S_InitializeDefaultDB() function directly. More...

int S_CreateDefaultDB (CERTC_CTX ctx, DEFAULT_DB_PARAMS *params)
 Creates a new local database. More...

int S_DeleteDefaultDB (CERTC_CTX ctx, DEFAULT_DB_PARAMS *params)
 Deletes a local database. More...

int S_GetDefaultDBList (CERTC_CTX ctx, char *path, LIST_OBJ dbList)
 Gets a list of databases stored in the specified file system path. More...


Function Documentation

int S_CreateDefaultDB CERTC_CTX    ctx,
DEFAULT_DB_PARAMS   params
;
 

Creates a new local database. The new database name must be unique relative to the specified path. S_CreateDefaultDB() creates the necessary database files and adds the database name to the path's list of databases.

Parameters:
ctx This input parameter points to an initialized Cert-C context handle.
params This input parameter should point to a structure of type DEFAULT_DB_PARAMS. If this parameter is set to NULL_PTR, the Cert-C Default Database service provider assumes the database path is the current working directory and the database name is default. The DEFAULT_DB_PARAMS.password field is ignored.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int S_DeleteDefaultDB CERTC_CTX    ctx,
DEFAULT_DB_PARAMS   params
;
 

Deletes a local database. The database name must match one created previously in the specified path. S_DeleteDefaultDB() deletes all of the files associated with the database.

Parameters:
ctx This input parameter points to an initialized Cert-C context handle.
params This input parameter should point to a structure of type DEFAULT_DB_PARAMS. If this parameter is set to NULL_PTR, the Cert-C Default Database service provider assumes the database path is the current working directory and the database name is default. The DEFAULT_DB_PARAMS.password field is ignored.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int S_GetDefaultDBList CERTC_CTX    ctx,
char *    path,
LIST_OBJ    dbList
;
 

Gets a list of databases stored in the specified file system path.

Parameters:
ctx This input parameter points to an initialized Cert-C context handle.
path This input parameter points to the file system path (or directory) where the database files are stored. If the path is set to (char *)NUL_PTR, the current working directory is assumed.
dbList This is both an input and output parameter. As an input parameter, it points to an allocated but uninitialized LIST_OBJ. As an output parameter, it points to an initialized LIST_OBJ. This function adds all of the database names, defined in the specified directory, to the list. Each list entry is a NUL-terminated character string.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int S_InitializeDefaultDB POINTER    ctx,
POINTER    params,
SERVICE_FUNCS   funcs,
POINTER *    handle
;
 

Never call the S_InitializeDefaultDB() function directly. Instead, to initialize or register the Cert-C Default 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_InitializeDefaultDB() function, and the corresponding POINTER should point to a DEFAULT_DB_PARAMS structure, or be set it to NULL_PTR.

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

Parameters:
ctx This input parameter points to an initialized Cert-C context handle.
params This input parameter should point to a structure of type DEFAULT_DB_PARAMS. If this parameter is set to NULL_PTR, the service provider assumes that the database path is the current working directory, the database name is default and the password is empty (length zero).
funcs 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 Default Database service provider-specific functions in SERVICE_FUNCS's db member, which is a DB_FUNCS structure.
handle This output parameter points to an allocated private database structure returned by this function.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.



RSA BSAFE® Cert-C 2.7 API Reference