1 SUNW_C_GETMECHSESSION(3EXT) Extended Library Functions 2 3 4 5 NAME 6 SUNW_C_GetMechSession, SUNW_C_KeyToObject - PKCS#11 Cryptographic 7 Framework functions 8 9 SYNOPSIS 10 cc [ flag ... ] file... -lpkcs11 [ library... ] 11 #include <security/cryptoki.h> 12 #include <security/pkcs11.h> 13 14 CK_RV SUNW_C_GetMechSession(CK_MECHANISM_TYPE mech, 15 CK_SESSION_HANDLE_PTR hSession); 16 17 18 CK_RV SUNW_C_KeyToObject(CK_SESSION_HANDLE hSession, 19 CK_MECHANISM_TYPE mech, const void *rawkey, size_t rawkey_len, 20 CK_OBJECT_HANDLE_PTR obj); 21 22 23 DESCRIPTION 24 These functions implement the RSA PKCS#11 v2.20 specification by using 25 plug-ins to provide the slots. 26 27 28 The SUNW_C_GetMechSession() function initializes the PKCS#11 29 cryptographic framework and performs all necessary calls to Standard 30 PKCS#11 functions (see libpkcs11(3LIB)) to create a session capable of 31 providing operations on the requested mechanism. It is not necessary to 32 call C_Initialize() or C_GetSlotList() before the first call to 33 SUNW_C_GetMechSession(). 34 35 36 If the SUNW_C_GetMechSession() function is called multiple times, it 37 will return a new session each time without re-initializing the 38 framework. If it is unable to return a new session, CKR_SESSION_COUNT 39 is returned. 40 41 42 The C_CloseSession() function should be called to release the session 43 when it is no longer required. 44 45 46 The SUNW_C_KeyToObject() function creates a key object for the 47 specified mechanism from the rawkey data. The object should be 48 destroyed with C_DestroyObject() when it is no longer required. 49 50 RETURN VALUES 51 The SUNW_C_GetMechSession() function returns the following values: 52 53 CKR_OK 54 The function completed successfully. 55 56 57 CKR_SESSION_COUNT 58 No sessions are available. 59 60 61 CKR_ARGUMENTS_BAD 62 A null pointer was passed for the return 63 session handle. 64 65 66 CKR_MECHANISM_INVALID 67 The requested mechanism is invalid or no 68 available plug-in provider supports it. 69 70 71 CKR_FUNCTION_FAILED 72 The function failed. 73 74 75 CKR_GENERAL_ERROR 76 A general error occurred. 77 78 79 80 The SUNW_C_KeyToObject() function returns the following values: 81 82 CKR_OK 83 The function completed successfully. 84 85 86 CKR_ARGUMENTS_BAD 87 A null pointer was passed for the session 88 handle or the key material. 89 90 91 CKR_MECHANISM_INVALID 92 The requested mechanism is invalid or no 93 available plug-in provider supports it. 94 95 96 CKR_FUNCTION_FAILED 97 The function failed. 98 99 100 CKR_GENERAL_ERROR 101 A general error occurred. 102 103 104 105 The return values of each of the implemented functions are defined and 106 listed in the RSA PKCS#11 v2.20 specification. See 107 http://www.rsasecurity.com. 108 109 USAGE 110 These functions are not part of the RSA PKCS#11 v2.20 specification. 111 They are not likely to exist on non-Solaris systems. They are provided 112 as a convenience to application programmers. Use of these functions 113 will make the application non-portable to other systems. 114 115 ATTRIBUTES 116 See attributes(5) for descriptions of the following attributes: 117 118 119 120 121 +--------------------+-----------------+ 122 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 123 +--------------------+-----------------+ 124 |Interface Stability | Evolving | 125 +--------------------+-----------------+ 126 |MT-Level | MT-Safe | 127 +--------------------+-----------------+ 128 129 SEE ALSO 130 libpkcs11(3LIB), attributes(5) 131 132 133 http://www.rsasecurity.com 134 135 136 137 August 27, 2019 SUNW_C_GETMECHSESSION(3EXT)