FreeRTOS: PKCS11
PKCS11 Cryptoki Library
Return to main page ↑
C_DestroyObject

Destroys an object.

CK_DECLARE_FUNCTION( CK_RV, C_DestroyObject )( CK_SESSION_HANDLE hSession,
CK_OBJECT_HANDLE hObject )
{
const P11Session_t * pxSession = prvSessionPointerFromHandle( hSession );
CK_RV xResult = prvCheckValidSessionAndModule( pxSession );
if( xResult == CKR_OK )
{
xResult = PKCS11_PAL_DestroyObject( hObject );
}
return xResult;
}
Parameters
[in]hSessionHandle of a valid PKCS #11 session.
[in]hObjectHandle of the object to be destroyed.
Warning
In this implementation, if either the device public key or the device private key (labels pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS and pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS) are deleted, both keys will be destroyed.
Returns
CKR_OK if successful. Else, see PKCS #11 specification for more information.
CK_DECLARE_FUNCTION
#define CK_DECLARE_FUNCTION(returnType, name)
Macro for defining a PKCS #11 functions.
Definition: iot_pkcs11.h:66
PKCS11_PAL_DestroyObject
CK_RV PKCS11_PAL_DestroyObject(CK_OBJECT_HANDLE xHandle)
Delete an object from NVM.
Definition: iot_pkcs11_mbedtls.c:1211
C_DestroyObject
CK_RV C_DestroyObject(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject)
Destroys an object.
Definition: iot_pkcs11_mbedtls.c:2511
prvSessionPointerFromHandle
static P11Session_t * prvSessionPointerFromHandle(CK_SESSION_HANDLE xSession)
Maps an opaque caller session handle into its internal state structure.
Definition: iot_pkcs11_mbedtls.c:287
prvCheckValidSessionAndModule
static CK_RV prvCheckValidSessionAndModule(const P11Session_t *pxSession)
Helper to check if the current session is initialized and valid.
Definition: iot_pkcs11_mbedtls.c:248
P11Session_t
Session structure.
Definition: iot_pkcs11_mbedtls.c:217