'\" te .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH SUNW_C_GETMECHSESSION 3EXT "Aug 27, 2019" .SH NAME SUNW_C_GetMechSession, SUNW_C_KeyToObject \- PKCS#11 Cryptographic Framework functions .SH SYNOPSIS .nf cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-lpkcs11\fR [ \fIlibrary\&.\|.\|.\fR ] #include #include \fBCK_RV\fR \fBSUNW_C_GetMechSession\fR(\fBCK_MECHANISM_TYPE\fR \fImech\fR, \fBCK_SESSION_HANDLE_PTR\fR \fIhSession\fR); .fi .LP .nf \fBCK_RV\fR \fBSUNW_C_KeyToObject\fR(\fBCK_SESSION_HANDLE\fR \fIhSession\fR, \fBCK_MECHANISM_TYPE\fR \fImech\fR, \fBconst void *\fR\fIrawkey\fR, \fBsize_t\fR \fIrawkey_len\fR, \fBCK_OBJECT_HANDLE_PTR\fR \fIobj\fR); .fi .SH DESCRIPTION These functions implement the RSA PKCS#11 v2.20 specification by using plug-ins to provide the slots. .sp .LP The \fBSUNW_C_GetMechSession()\fR function initializes the PKCS#11 cryptographic framework and performs all necessary calls to Standard PKCS#11 functions (see \fBlibpkcs11\fR(3LIB)) to create a session capable of providing operations on the requested mechanism. It is not necessary to call \fBC_Initialize()\fR or \fBC_GetSlotList()\fR before the first call to \fBSUNW_C_GetMechSession()\fR. .sp .LP If the \fBSUNW_C_GetMechSession()\fR 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, \fBCKR_SESSION_COUNT\fR is returned. .sp .LP The \fBC_CloseSession()\fR function should be called to release the session when it is no longer required. .sp .LP The \fBSUNW_C_KeyToObject()\fR function creates a key object for the specified mechanism from the \fIrawkey\fR data. The object should be destroyed with \fBC_DestroyObject()\fR when it is no longer required. .SH RETURN VALUES The \fBSUNW_C_GetMechSession()\fR function returns the following values: .sp .ne 2 .na \fB\fBCKR_OK\fR\fR .ad .RS 25n The function completed successfully. .RE .sp .ne 2 .na \fB\fBCKR_SESSION_COUNT\fR\fR .ad .RS 25n No sessions are available. .RE .sp .ne 2 .na \fB\fBCKR_ARGUMENTS_BAD\fR\fR .ad .RS 25n A null pointer was passed for the return session handle. .RE .sp .ne 2 .na \fB\fBCKR_MECHANISM_INVALID\fR\fR .ad .RS 25n The requested mechanism is invalid or no available plug-in provider supports it. .RE .sp .ne 2 .na \fB\fBCKR_FUNCTION_FAILED\fR\fR .ad .RS 25n The function failed. .RE .sp .ne 2 .na \fB\fBCKR_GENERAL_ERROR\fR\fR .ad .RS 25n A general error occurred. .RE .sp .LP The \fBSUNW_C_KeyToObject()\fR function returns the following values: .sp .ne 2 .na \fB\fBCKR_OK\fR\fR .ad .RS 25n The function completed successfully. .RE .sp .ne 2 .na \fB\fBCKR_ARGUMENTS_BAD\fR\fR .ad .RS 25n A null pointer was passed for the session handle or the key material. .RE .sp .ne 2 .na \fB\fBCKR_MECHANISM_INVALID\fR\fR .ad .RS 25n The requested mechanism is invalid or no available plug-in provider supports it. .RE .sp .ne 2 .na \fB\fBCKR_FUNCTION_FAILED\fR\fR .ad .RS 25n The function failed. .RE .sp .ne 2 .na \fB\fBCKR_GENERAL_ERROR\fR\fR .ad .RS 25n A general error occurred. .RE .sp .LP 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. .SH USAGE 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 application programmers. Use of these functions will make the application non-portable to other systems. .SH ATTRIBUTES See \fBattributes\fR(7) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Evolving _ MT-Level MT-Safe .TE .SH SEE ALSO .BR libpkcs11 (3LIB), .BR attributes (7) .sp .LP http://www.rsasecurity.com