Reference Guide

18 Chapter 3: Resource Management
RSA BSAFE Crypto-C Micro Edition 3.x to 4.1.4 Migration Guide
Common Resources
Resources that provide core Crypto-C ME functionality, required to use resources
from any of the providers, are available from the
ccme_core library file. These
common resources can be accessed individually for custom resource lists, or as a list
using
R_PROV_SOFTWARE_get_default_resource_list().
Software Provider
The software provider supplies the software implementations of the cryptographic
functionality previously found in the
cryptocme_standard library. The software
provider is available when linking against the
ccme_swprov library.
All of the software provider functionality, except for the cryptographically insecure
export cipher implementations, is available from the default resource list, which is
returned from
R_PROV_SOFTWARE_get_default_resource_list().
Applications that previously used
PRODUCT_DEFAULT_RESOURCE_LIST() now
need to use the default resource list from the software provider.
The following code examples show setting up the default software resources for
Crypto-C ME 3.x and Crypto-C ME 4.1.4.
Default Software Resources - Crypto-C ME 3.x
int main(int argc, char **argv)
{
int ret;
R_LIB_CTX *lib_ctx = NULL;
R_RES_LIST *list = PRODUCT_DEFAULT_RESOURCE_LIST();
ret = PRODUCT_LIBRARY_NEW(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;
}
Default Software Resources - Crypto-C ME 4.1.4
int main(int argc, char **argv)
{
int ret;
R_LIB_CTX *lib_ctx = NULL;
R_RES_LIST *list =
R_PROV_SOFTWARE_get_default_resource_list();
ret = R_STATE_init_defaults();
if (R_ERROR_NONE != ret)
return 1;