RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

r_lib.h File Reference

This file provides information on the structures, function prototypes and defines used in the manipulation of library context objects.

#include "r_com.h"
#include "r_res.h"
#include "r_flg.h"
#include "r_strtbl.h"
#include "bio.h"

Go to the source code of this file.

Defines

#define R_LIB_CTX_INFO_ID_RESOURCE_LIST
 Indicates the resource list of the library context.

#define R_LIB_CTX_INFO_ID_MODE
 Indicates the default mode of the library context.

#define R_LIB_CTX_STANDARD_MODE
 Indicates that FIPS 140 mode is disabled for the library.

#define R_LIB_CTX_SOFTWARE_MODE
 Indicates that software mode is enabled for the library.


Typedefs

typedef struct r_lib_ctx_st R_LIB_CTX
 The common library context. More...

typedef struct r_lib_method_st R_LIB_METHOD
 The library method table. More...


Functions

int R_CDECL R_LIB_CTX_new (R_RES_LIST *r_list, R_RES_FLAG flag, R_LIB_CTX **lib_ctx)
 Allocates the library context based upon a supplied resource list. More...

int R_CDECL R_LIB_CTX_free (R_LIB_CTX *lib_ctx)
 Deallocates the library context. More...

int R_CDECL R_LIB_CTX_set_info (R_LIB_CTX *lib_ctx, int info_id, void *value)
 Sets information into the library context R_LIB_CTX. More...

int R_CDECL R_LIB_CTX_get_info (R_LIB_CTX *lib_ctx, int info_id, void *value)
 Returns the requested information from the library context R_LIB_CTX. More...


Typedef Documentation

typedef struct r_lib_ctx_st R_LIB_CTX
 

The common library context. This opaque structure is required by all other R_LIB_CTX functions. It maintains the state required by the library during execution. It can be freed via R_LIB_CTX_free() when it is no longer required. Under normal circumstances only one context is needed at a time.

typedef struct r_lib_method_st R_LIB_METHOD
 

The library method table. An opaque structure that contains the methods for the R_LIB_CTX functions.


Function Documentation

int R_CDECL R_LIB_CTX_free R_LIB_CTX   lib_ctx ;
 

Deallocates the library context.

Parameters:
lib_ctx [In] The R_LIB_CTX reference.
Returns:
R_ERROR_NONE indicates success.
See Identifiers for valid values.
note.gif
This function is the default library context deallocation function. This function should be called where product-specific library de-allocation functions exist. It is the calling application's responsibility to set the library context reference lib_ctx to NULL after this function has been called.
See also:
R_LIB_CTX_new().
Samples:
cert_smpl.c, req.c, req_smpl.c, reqgen.c, and ss_cert_smpl.c.

int R_CDECL R_LIB_CTX_get_info R_LIB_CTX   lib_ctx,
int    info_id,
void *    value
;
 

Returns the requested information from the library context R_LIB_CTX.

Parameters:
lib_ctx [In] The library context containing the data to retrieve.
info_id [In] The information identifier.
value [Out] The data to fill with the requested information.
Returns:
R_ERROR_NONE indicates success.
See Identifiers for valid values.
Samples:
reslist_set.c.

int R_CDECL R_LIB_CTX_new R_RES_LIST   r_list,
R_RES_FLAG    flag,
R_LIB_CTX **    lib_ctx
;
 

Allocates the library context based upon a supplied resource list.

Parameters:
r_list [In] The resource list reference.
flag [In] The library initialization flags.
lib_ctx [Out] The allocated library context.
Returns:
R_ERROR_NONE indicates success.
See Identifiers for valid values.
See also:
R_LIB_CTX_free().
Samples:
ss_cert_smpl.c, and verify.c.

int R_CDECL R_LIB_CTX_set_info R_LIB_CTX   lib_ctx,
int    info_id,
void *    value
;
 

Sets information into the library context R_LIB_CTX.

Parameters:
lib_ctx [In] The library context into which to set the data.
info_id [In] The information identifier.
value [In] The data to set.
Returns:
R_ERROR_NONE indicates success.
See Identifiers for valid values.
See also:
R_LIB_CTX_get_info().
Samples:
s_crl_check.c, and s_crl_verify.c.


Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 072-001001-2100-001-000 - 2.1