Reference Guide

Chapter 3: Resource Management 19
RSA BSAFE Crypto-C Micro Edition 3.x to 4.1.4 Migration Guide
ret = R_LIB_CTX_new_ef(list, NULL, &lib_ctx);
if (R_ERROR_NONE != ret)
goto end;
/* Perform Cryptographic operations */
end:
R_LIB_CTX_free(lib_ctx);
R_STATE_cleanup();
return 0;
}
The following code examples show setting up a custom resource list for
Crypto-C ME 3.x and Crypto-C ME 4.1.4.
Custom Resource List - Crypto-C ME 3.x
static const R_RESLIST resource_list[] =
{
/* List of resources to include */
};
int main(int argc, char **argv)
{
int ret;
R_LIB_CTX *lib_ctx = NULL;
ret = PRODUCT_LIBRARY_NEW(&resource_list,
R_RES_FLAG_DEFAULT, &lib_ctx);
if (R_ERROR_NONE != ret)
goto end;
/* Perform cryptographic operations */
end:
R_LIB_CTX_free(lib_ctx);
return 0;
}
Custom Resource List - Crypto-C ME 4.1.4
static const R_RESOURCE * resource_list[] =
{
/* List of resources to include */
};
int main(int argc, char **argv)
{
int ret;
R_LIB_CTX *lib_ctx = NULL;
ret = R_STATE_init_defaults();
if (R_ERROR_NONE != ret)
return 1;
ret = R_LIB_CTX_new_ef(&resource_list, NULL, &lib_ctx);
if (R_ERROR_NONE != ret)
goto end;
/* Perform cryptographic operations */