Initializes Cryptoki.
{
CK_RV xResult = CKR_OK;
( void ) ( pInitArgs );
{
if( xResult == CKR_OK )
{
}
else
{
LogError( (
"Failed to initialize PKCS #11. PAL failed with error code: 0x%0lX", (
unsigned long int ) xResult ) );
}
}
else
{
xResult = CKR_CRYPTOKI_ALREADY_INITIALIZED;
LogWarn( (
"Failed to initialize PKCS #11. PKCS #11 was already initialized." ) );
}
if( xResult == CKR_OK )
{
LogInfo( (
"PKCS #11 successfully initialized." ) );
}
return xResult;
}
#define CK_DECLARE_FUNCTION(returnType, name)
Macro for defining a PKCS #11 functions.
Definition: core_pkcs11.h:77
#define LogInfo(message)
Macro that is called in the corePKCS11 library for logging "Info" level messages.
Definition: core_pkcs11_config_defaults.h:357
#define LogWarn(message)
Macro that is called in the corePKCS11 library for logging "Warning" level messages.
Definition: core_pkcs11_config_defaults.h:337
#define LogError(message)
Macro that is called in the corePKCS11 library for logging "Error" level messages.
Definition: core_pkcs11_config_defaults.h:317
CK_RV C_Initialize(CK_VOID_PTR pInitArgs)
Initializes Cryptoki.
Definition: core_pkcs11_mbedtls.c:1422
static P11Struct_t xP11Context
The global PKCS #11 module object. Entropy/randomness and object lists are shared across PKCS #11 ses...
Definition: core_pkcs11_mbedtls.c:326
static CK_RV prvMbedTLS_Initialize(void)
Initialize mbedTLS.
Definition: core_pkcs11_mbedtls.c:448
CK_RV PKCS11_PAL_Initialize(void)
Initializes the PKCS #11 PAL.
CK_BBOOL xIsInitialized
Indicates whether PKCS #11 module has been initialized with a call to C_Initialize.
Definition: core_pkcs11_mbedtls.c:285
- Note
- C_Initialize is not thread-safe.
C_Initialize should be called (and allowed to return) before any additional PKCS #11 operations are invoked.
In this implementation, all arguments are ignored. Thread protection for the rest of PKCS #11 functions default to FreeRTOS primitives.
- Parameters
-
[in] | pInitArgs | This parameter is ignored. |
- Returns
- CKR_OK if successful. CKR_CRYPTOKI_ALREADY_INITIALIZED if C_Initialize was previously called. All other errors indicate that the PKCS #11 module is not ready to be used.