RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

context.h File Reference

This file contains Cert-C context-management routines.

#include "basetype.h"
#include "service.h"

Go to the source code of this file.

Functions

int C_InitializeCertC (SERVICE_HANDLER *handlers, POINTER *handlerParams, unsigned int handlerCount, CERTC_CTX *ctx)
 Creates the Cert-C context and initializes the specified service providers and the internal fields of the context. More...

void C_FinalizeCertC (CERTC_CTX *ctx)
 Unregisters all currently registered service providers. More...

int C_SetCertCFlags (CERTC_CTX ctx, UINT4 flags)
 Sets the current set of behavior flags for this CERTC_CTX to the specified values. More...

int C_GetCertCFlags (CERTC_CTX ctx, UINT4 *pFlags)
 Retrieves the current set of behavior flags for this CERTC_CTX. More...


Function Documentation

void C_FinalizeCertC CERTC_CTX   ctx ;
 

Unregisters all currently registered service providers. Frees all memory associated with the context and sets the context to (CERTC_CTX)0.

Parameters:
ctx [In, Out] As an input parameter, points to an initialized Cert-C context. As an output parameter, sets the context to (CERTC_CTX)0 before it returns. If it is already (CERTC_CTX)0, then no action is taken.
Samples:
array.c, asn1.c, attrib.c, attributil.c, cert.c, certsonly.c, cftest.c, chain.c, cmp.c, cmpku.c, cmpreq.c, cmprev.c, cms.c, critical.c, crl.c, crmf.c, datamsg.c, demo.c, dhcert.c, exten.c, extract.c, imdbcert.c, imdbpvt.c, kcscrs.c, kcsscep.c, keypair.c, keywrap.c, ldap.c, ldap2.c, mscapicert.c, mscapiroots.c, name.c, ocsp.c, p11dbimp.c, p11dblist.c, p12memio.c, p7stream.c, pkcs10.c, pkcs11db.c, pkcs11msg.c, pkcs12.c, pkcs12exp.c, roleattrib.c, rsadbcert.c, rsadbm.c, rsadbpvt.c, saltname.c, scepdb.c, scepreq.c, smplsaltnm.c, sslcpvt.c, usememio.c, validate.c, and verisign.c.

int C_GetCertCFlags CERTC_CTX    ctx,
UINT4   pFlags
;
 

Retrieves the current set of behavior flags for this CERTC_CTX. This function is not generally needed by applications.

Parameters:
ctx [In] A pointer to the initialized Cert-C context from which the current set of behavioral flags are retrieved.
pFlags [Out] The location where the flags bitmask is to be stored.
Returns:
0 indicates success.
See Errors for error information.

int C_InitializeCertC SERVICE_HANDLER   handlers,
POINTER   handlerParams,
unsigned int    handlerCount,
CERTC_CTX   ctx
;
 

Creates the Cert-C context and initializes the specified service providers and the internal fields of the context. The application should call this function before calling any other Cert-C function. The service providers are initialized in order of type and in the specified order within each type.

The service-provider type order is:

  1. SPT_SURRENDER
  2. SPT_LOG
  3. SPT_CRYPTO
  4. SPT_IO
  5. SPT_DATABASE2
  6. SPT_DATABASE
  7. SPT_CERT_STATUS
  8. SPT_CERT_PATH
  9. SPT_PKI.
note.gif
Only a single instance of the SPT_SURRENDER or SPT_CRYPTO service-provider types can be registered at a given time.

Cert-C is threadsafe but not multi-threaded. You can use Cert-C in multi-threaded applications if you are careful not to use the objects created by Cert-C in multiple threads at the same time. This will result in corrupted data or other errors. Cert-C does not spawn off threads of its own. Each thread must call this function, which in turn calls the initialization functions of all of the service providers. The Cert-C context (which bundles all of the service-provider handles) is assumed to be thread-specific.

Parameters:
handlers [In] A pointer to an array of service handlers. Each entry in the array defines a service provider to be initialized. The number of entries in the array is defined by handlerCount.
handlerParams [In] A pointer to an array of service-handler initialization parameters. Each entry in the array is a pointer to the initialization parameters of the corresponding entry in the handlers array. The data type of the initialization parameters is defined by the service provider. If all of the initialization parameters to the service providers are zero, the application can pass (POINTER *)0 for the array instead of having to construct an array of NULL_PTRs.
handlerCount [In] The number of entries in the handlers and handlerParams arrays.
ctx [Out] A pointer to the location where the Cert-C context pointer will be stored.
Returns:
0 indicates success.
See Errors for error information.
Samples:
array.c, asn1.c, attrib.c, attributil.c, cert.c, certsonly.c, cftest.c, chain.c, cmp.c, cmpku.c, cmpreq.c, cmprev.c, cms.c, critical.c, crl.c, crmf.c, datamsg.c, dhcert.c, exten.c, extract.c, imdbcert.c, imdbpvt.c, kcscrs.c, kcsscep.c, keypair.c, keywrap.c, ldap.c, ldap2.c, mscapicert.c, mscapiroots.c, name.c, ocsp.c, p11dbimp.c, p11dblist.c, p12memio.c, p7stream.c, pkcs10.c, pkcs11db.c, pkcs11msg.c, pkcs12.c, pkcs12exp.c, roleattrib.c, rsadbcert.c, rsadbm.c, rsadbpvt.c, saltname.c, scepdb.c, scepreq.c, smplsaltnm.c, sslcpvt.c, usememio.c, validate.c, and verisign.c.

int C_SetCertCFlags CERTC_CTX    ctx,
UINT4    flags
;
 

Sets the current set of behavior flags for this CERTC_CTX to the specified values. These flags may be necessary to indicate desired code behaviors for backwards-compatability purposes. The flags may be any not-mutually-incompatible set of CERTC_CTX_FLAG_* values. All undefined bits in the flags bitmask must be cleared.

Calls to this API should generally be performed immediately after the CERTC_CTX is initialized with C_InitializeCertC(). After that, the behavior of the toolkit is undefined.

Parameters:
ctx [In, Out] As an input parameter, points to an initialized Cert-C context. As an output parameter, it is the context containing the current behavioral flags set.
flags [In] The a bitmask of CERTC_CTX_FLAG_* behavioral flags to be set.
Returns:
0 indicates success.
See Errors for error information.
Samples:
cms.c.


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 067-001001-2720-001-000 - 2.7.2