1 '\" te
   2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" 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.
   4 .\" 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.
   5 .\" 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]
   6 .TH SUNW_C_GETMECHSESSION 3EXT "Aug 27, 2019"
   7 .SH NAME
   8 SUNW_C_GetMechSession, SUNW_C_KeyToObject \- PKCS#11 Cryptographic Framework
   9 functions
  10 .SH SYNOPSIS
  11 .nf
  12 cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-lpkcs11\fR [ \fIlibrary\&.\|.\|.\fR ]
  13 #include <security/cryptoki.h>
  14 #include <security/pkcs11.h>
  15 
  16 \fBCK_RV\fR \fBSUNW_C_GetMechSession\fR(\fBCK_MECHANISM_TYPE\fR \fImech\fR,
  17      \fBCK_SESSION_HANDLE_PTR\fR \fIhSession\fR);
  18 .fi
  19 
  20 .LP
  21 .nf
  22 \fBCK_RV\fR \fBSUNW_C_KeyToObject\fR(\fBCK_SESSION_HANDLE\fR \fIhSession\fR,
  23      \fBCK_MECHANISM_TYPE\fR \fImech\fR, \fBconst void *\fR\fIrawkey\fR, \fBsize_t\fR \fIrawkey_len\fR,
  24      \fBCK_OBJECT_HANDLE_PTR\fR \fIobj\fR);
  25 .fi
  26 
  27 .SH DESCRIPTION
  28 These functions implement the RSA PKCS#11 v2.20 specification by using plug-ins
  29 to provide the slots.
  30 .sp
  31 .LP
  32 The \fBSUNW_C_GetMechSession()\fR function initializes the PKCS#11
  33 cryptographic framework and performs all necessary calls to Standard PKCS#11
  34 functions (see \fBlibpkcs11\fR(3LIB)) to create a session capable of providing
  35 operations on the requested mechanism. It is not necessary to call
  36 \fBC_Initialize()\fR or \fBC_GetSlotList()\fR before the first call to
  37 \fBSUNW_C_GetMechSession()\fR.
  38 .sp
  39 .LP
  40 If the \fBSUNW_C_GetMechSession()\fR function is called multiple times, it will
  41 return a new session each time without re-initializing the framework. If it is
  42 unable to return a new session, \fBCKR_SESSION_COUNT\fR is returned.
  43 .sp
  44 .LP
  45 The \fBC_CloseSession()\fR function should be called to release the session
  46 when it is no longer required.
  47 .sp
  48 .LP
  49 The \fBSUNW_C_KeyToObject()\fR function creates a key object for the specified
  50 mechanism from the \fIrawkey\fR data. The object should be destroyed with
  51 \fBC_DestroyObject()\fR when it is no longer required.
  52 .SH RETURN VALUES
  53 The \fBSUNW_C_GetMechSession()\fR function returns the following values:
  54 .sp
  55 .ne 2
  56 .na
  57 \fB\fBCKR_OK\fR\fR
  58 .ad
  59 .RS 25n
  60 The function completed successfully.
  61 .RE
  62 
  63 .sp
  64 .ne 2
  65 .na
  66 \fB\fBCKR_SESSION_COUNT\fR\fR
  67 .ad
  68 .RS 25n
  69 No sessions are available.
  70 .RE
  71 
  72 .sp
  73 .ne 2
  74 .na
  75 \fB\fBCKR_ARGUMENTS_BAD\fR\fR
  76 .ad
  77 .RS 25n
  78 A null pointer was passed for the return session handle.
  79 .RE
  80 
  81 .sp
  82 .ne 2
  83 .na
  84 \fB\fBCKR_MECHANISM_INVALID\fR\fR
  85 .ad
  86 .RS 25n
  87 The requested mechanism is invalid or no available plug-in provider supports
  88 it.
  89 .RE
  90 
  91 .sp
  92 .ne 2
  93 .na
  94 \fB\fBCKR_FUNCTION_FAILED\fR\fR
  95 .ad
  96 .RS 25n
  97 The function failed.
  98 .RE
  99 
 100 .sp
 101 .ne 2
 102 .na
 103 \fB\fBCKR_GENERAL_ERROR\fR\fR
 104 .ad
 105 .RS 25n
 106 A general error occurred.
 107 .RE
 108 
 109 .sp
 110 .LP
 111 The \fBSUNW_C_KeyToObject()\fR function returns the following values:
 112 .sp
 113 .ne 2
 114 .na
 115 \fB\fBCKR_OK\fR\fR
 116 .ad
 117 .RS 25n
 118 The function completed successfully.
 119 .RE
 120 
 121 .sp
 122 .ne 2
 123 .na
 124 \fB\fBCKR_ARGUMENTS_BAD\fR\fR
 125 .ad
 126 .RS 25n
 127 A null pointer was passed for the session handle or the key material.
 128 .RE
 129 
 130 .sp
 131 .ne 2
 132 .na
 133 \fB\fBCKR_MECHANISM_INVALID\fR\fR
 134 .ad
 135 .RS 25n
 136 The requested mechanism is invalid or no available plug-in provider supports
 137 it.
 138 .RE
 139 
 140 .sp
 141 .ne 2
 142 .na
 143 \fB\fBCKR_FUNCTION_FAILED\fR\fR
 144 .ad
 145 .RS 25n
 146 The function failed.
 147 .RE
 148 
 149 .sp
 150 .ne 2
 151 .na
 152 \fB\fBCKR_GENERAL_ERROR\fR\fR
 153 .ad
 154 .RS 25n
 155 A general error occurred.
 156 .RE
 157 
 158 .sp
 159 .LP
 160 The return values of each of the implemented functions are defined and listed
 161 in the RSA PKCS#11 v2.20 specification. See http://www.rsasecurity.com.
 162 .SH USAGE
 163 These functions are not part of the RSA PKCS#11 v2.20 specification. They are
 164 not likely to exist on non-Solaris systems. They are provided as a convenience
 165 to application programmers. Use of these functions will make the application
 166 non-portable to other systems.
 167 .SH ATTRIBUTES
 168 See \fBattributes\fR(5) for descriptions of the following attributes:
 169 .sp
 170 
 171 .sp
 172 .TS
 173 box;
 174 c | c
 175 l | l .
 176 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 177 _
 178 Interface Stability     Evolving
 179 _
 180 MT-Level        MT-Safe
 181 .TE
 182 
 183 .SH SEE ALSO
 184 \fBlibpkcs11\fR(3LIB), \fBattributes\fR(5)
 185 .sp
 186 .LP
 187 http://www.rsasecurity.com