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 GSS_STORE_CRED 3GSS "April 9, 2016"
8 gss_store_cred \- store a credential in the current credential store
12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lgss\fR [ \fIlibrary\fR... ]
13 #include <gssapi/gssapi.h>
15 \fBOM_uint32\fR \fBgss_store_cred\fR(\fBOM_uint32 *\fR\fIminor_status\fR,
16 \fBconst gss_cred_id_t\fR \fIinput_cred\fR, \fBconst gss_cred_usage_t\fR \fIcred_usage\fR,
17 \fBconst gss_OID\fR \fIdesired_mech\fR, \fBOM_uint32\fR \fIoverwrite_cred\fR,
18 \fBOM_uint32\fR \fIdefault_cred\fR, \fBgss_OID_set *\fR\fIelements_stored\fR,
19 \fBgss_cred_usage_t *\fR\fIcred_usage_stored\fR);
24 The parameter descriptions for \fBgss_store_cred()\fR follow:
28 \fB\fIinput_cred\fR\fR
31 The credential to be stored.
37 \fB\fIcred_usage\fR\fR
40 This parameter specifies whether to store an initiator, an acceptor, or both
41 usage components of a credential.
47 \fB\fIdesired_mech\fR\fR
50 The mechanism-specific component of a credential to be stored. If
51 \fBGSS_C_NULL_OID\fR is specified, the \fBgss_store_cred()\fR function attempts
52 to store all the elements of the given \fIinput_cred_handle\fR.
54 The \fBgss_store_cred()\fR function is not atomic when storing multiple
55 elements of a credential. All delegated credentials, however, contain a single
62 \fB\fIoverwrite_cred\fR\fR
65 A boolean that indicates whether to overwrite existing credentials in the
66 current store for the same principal as that of the \fIinput_cred_handle\fR. A
67 non-zero value indicates that credentials are overwritten. A zero value
68 indicates that credentials are not overwritten.
74 \fB\fIdefault_cred\fR\fR
77 A boolean that indicates whether to set the principal name of the
78 \fIinput_cred_handle\fR parameter as the default of the current credential
79 store. A non-zero value indicates that the principal name is set as the
80 default. A zero value indicates that the principal name is not set as the
81 default. The default principal of a credential store matches
82 \fBGSS_C_NO_NAME\fR as the \fIdesired_name\fR input parameter for
89 \fB\fIelements_stored\fR\fR
92 The set of mechanism \fBOID\fRs for which \fIinput_cred_handle\fR elements have
99 \fB\fIcred_usage_stored\fR\fR
102 The stored \fIinput_cred_handle\fR usage elements: initiator, acceptor, or
109 \fB\fIminor_status\fR\fR
112 Minor status code that is specific to one of the following: the mechanism
113 identified by the \fIdesired_mech_element\fR parameter, or the element of a
114 single mechanism in the \fIinput_cred_handle\fR. In all other cases,
115 \fIminor_status\fR has an undefined value on return.
120 The \fBgss_store_cred()\fR function stores a credential in the current
121 GSS-API credential store for the calling process. Input credentials can be
122 re-acquired through \fBgss_add_cred\fR(3GSS) and \fBgss_acquire_cred\fR(3GSS).
125 The \fBgss_store_cred()\fR function is specifically intended to make delegated
126 credentials available to a user's login session.
129 The \fBgss_accept_sec_context()\fR function can return a delegated GSS-API
130 credential to its caller. The function does not store delegated credentials to
131 be acquired through \fBgss_add_cred\fR(3GSS). Delegated credentials can be used
132 only by a receiving process unless they are made available for acquisition by
133 calling the \fBgss_store_cred()\fR function.
136 The Solaris Operating System supports a single GSS-API credential store per
137 user. The current GSS-API credential store of a process is determined by its
141 In general, acceptor applications should switch the current credential store by
142 changing the effective UID before storing a delegated credential.
145 The \fBgss_store_cred()\fR can return the following status codes:
149 \fB\fBGSS_S_COMPLETE\fR\fR
153 Successful completion.
159 \fB\fBGSS_S_CREDENTIALS_EXPIRED\fR\fR
163 The credentials could not be stored because they have expired.
169 \fB\fBGSS_S_CALL_INACCESSIBLE_READ\fR\fR
173 No input credentials were given.
179 \fB\fBGSS_S_UNAVAILABLE\fR\fR
183 The credential store is unavailable.
189 \fB\fBGSS_S_DUPLICATE_ELEMENT\fR\fR
193 The credentials could not be stored because the \fIoverwrite_cred\fR input
194 parameter was set to false (\fB0\fR) and the \fIinput_cred\fR parameter
195 conflicts with a credential in the current credential store.
201 \fB\fBGSS_S_FAILURE\fR\fR
205 The underlying mechanism detected an error for which no specific \fBGSS\fR
206 status code is defined. The mechanism-specific status code reported by means of
207 the \fIminor_status\fR parameter details the error condition.
212 See \fBattributes\fR(5) for descriptions of the following attributes:
220 ATTRIBUTE TYPE ATTRIBUTE VALUE
222 Interface Stability Unstable
229 \fBgss_accept_sec_context\fR(3GSS), \fBgss_acquire_cred\fR(3GSS),
230 \fBgss_add_cred\fR(3GSS), \fBgss_init_sec_context\fR(3GSS),
231 \fBgss_inquire_cred\fR(3GSS), \fBgss_release_cred\fR(3GSS),
232 \fBgss_release_oid_set\fR(3GSS), \fBattributes\fR(5)
235 \fISolaris Security for Developers Guide\fR