summaryrefslogtreecommitdiff
path: root/usr/src/man/man3ext/SUNW_C_GetMechSession.3ext
blob: 8dc3d31e61aa2f355b9f1990710daca8632d6a5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
'\" 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 "April 9, 2016"
.SH NAME
SUNW_C_GetMechSession, SUNW_C_KeyToObject \- PKCS#11 Cryptographic Framework
functions
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-lpkcs11\fR [ \fIlibrary\&.\|.\|.\fR ]
#include <security/cryptoki.h>
#include <security/pkcs11.h>

\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
.LP
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_Initalize()\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-initalizing 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
.LP
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
.LP
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
.LP
See \fBattributes\fR(5) 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
.LP
\fBlibpkcs11\fR(3LIB), \fBattributes\fR(5)
.sp
.LP
http://www.rsasecurity.com