Extended Library Functions SUNW_C_GetMechSession(3EXT)
NAME
SUNW_C_GetMechSession, SUNW_C_KeyToObject - PKCS#11 Crypto-
graphic Framework functionsSYNOPSIS
cc [ flag ... ] file... -lpkcs11 [ library... ]
#include
#include
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);
DESCRIPTION
These functions implement the RSA PKCS#11 v2.20 specifica-
tion by using plug-ins to provide the slots.
The SUNW_C_GetMechSession() function initializes the PKCS#11
cryptographic framework and performs all necessary calls toStandard PKCS#11 functions (see libpkcs11(3LIB)) to create a
session capable of providing operations on the requestedmechanism. It is not neccessary to call C_Initalize() 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-
initalizing the framework. If it is unable to return a newsession, 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 objectshould be destroyed with C_DestroyObject() when it is no
longer required.RETURN VALUES
The SUNW_C_GetMechSession() function returns the following
values:SunOS 5.11 Last change: 27 Oct 2005 1
Extended Library Functions SUNW_C_GetMechSession(3EXT)
CKR_OK The function completed success-
fully.CKR_SESSION_COUNT No sessions are available.
CKR_ARGUMENTS_BAD A null pointer was passed for the
return session handle.CKR_MECHANISM_INVALID The requested mechanism is invalid
or no available plug-in provider
supports it.CKR_FUNCTION_FAILED The function failed.
CKR_GENERAL_ERROR A general error occurred.
The SUNW_C_KeyToObject() function returns the following
values:CKR_OK The function completed success-
fully.CKR_ARGUMENTS_BAD A null pointer was passed for the
session handle or the key material.CKR_MECHANISM_INVALID The requested mechanism is invalid
or no available plug-in provider
supports it.CKR_FUNCTION_FAILED The function failed.
CKR_GENERAL_ERROR A general error occurred.
The return values of each of the implemented functions aredefined and listed in the RSA PKCS#11 v2.20 specification.
See http://www.rsasecurity.com.USAGE
SunOS 5.11 Last change: 27 Oct 2005 2
Extended Library Functions SUNW_C_GetMechSession(3EXT)
These functions are not part of the RSA PKCS#11 v2.20
specification. They are not likely to exist on non-Solaris
systems. They are provided as a convenience to applicationprogrammers. Use of these functions will make the applica-
tion non-portable to other systems.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| MT-Level | MT-Safe |
|_____________________________|_____________________________|
SEE ALSO
libpkcs11(3LIB), attributes(5) http://www.rsasecurity.comSunOS 5.11 Last change: 27 Oct 2005 3