SUNW_C_GETMECHSESSION(3EXT) | Extended Library Functions | SUNW_C_GETMECHSESSION(3EXT) |
cc [ flag ... ] file... -lpkcs11 [ library... ] #include <security/cryptoki.h> #include <security/pkcs11.h> CK_RV SUNW_C_GetMechSession(CK_MECHANISM_TYPE mech, CK_SESSION_HANDLE_PTR hSession);
CK_RV SUNW_C_KeyToObject(CK_SESSION_HANDLE hSession, CK_MECHANISM_TYPE mech, const void *rawkey, size_t rawkey_len, CK_OBJECT_HANDLE_PTR obj);
The SUNW_C_GetMechSession() function initializes the PKCS#11 cryptographic framework and performs all necessary calls to Standard PKCS#11 functions (see libpkcs11(3LIB)) to create a session capable of providing operations on the requested mechanism. It is not necessary to call C_Initialize() or C_GetSlotList() before the first call to SUNW_C_GetMechSession().
If the SUNW_C_GetMechSession() function is called multiple times, it will return a new session each time without re-initializing the framework. If it is unable to return a new session, CKR_SESSION_COUNT is returned.
The C_CloseSession() function should be called to release the session when it is no longer required.
The SUNW_C_KeyToObject() function creates a key object for the specified mechanism from the rawkey data. The object should be destroyed with C_DestroyObject() when it is no longer required.
CKR_OK
CKR_SESSION_COUNT
CKR_ARGUMENTS_BAD
CKR_MECHANISM_INVALID
CKR_FUNCTION_FAILED
CKR_GENERAL_ERROR
The SUNW_C_KeyToObject() function returns the following values:
CKR_OK
CKR_ARGUMENTS_BAD
CKR_MECHANISM_INVALID
CKR_FUNCTION_FAILED
CKR_GENERAL_ERROR
The return values of each of the implemented functions are defined and listed in the RSA PKCS#11 v2.20 specification. See http://www.rsasecurity.com.
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Evolving |
MT-Level | MT-Safe |
http://www.rsasecurity.com
August 27, 2019 |