]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/UserCredential.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Protocol / UserCredential.h
1 /** @file
2 UEFI 2.2 User Credential Protocol definition.
3
4 Attached to a device handle, this protocol identifies a single means of identifying the user.
5
6 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __USER_CREDENTIAL_H__
18 #define __USER_CREDENTIAL_H__
19
20 #include <Protocol/UserManager.h>
21
22 #define EFI_USER_CREDENTIAL_PROTOCOL_GUID \
23 { \
24 0x71ee5e94, 0x65b9, 0x45d5, { 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe } \
25 }
26
27 typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL;
28
29 /**
30 Enroll a user on a credential provider.
31
32 This function enrolls and deletes a user profile using this credential provider. If a user profile
33 is successfully enrolled, it calls the User Manager Protocol function Notify() to notify the user
34 manager driver that credential information has changed. If an enrolled user does exist, delete the
35 user on the credential provider.
36
37 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
38 @param[in] User The user profile to enroll.
39
40 @retval EFI_SUCCESS User profile was successfully enrolled.
41 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the user profile
42 handle. Either the user profile cannot enroll on any user profile or
43 cannot enroll on a user profile other than the current user profile.
44 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in the pre-OS.
45 @retval EFI_DEVICE_ERROR The new credential could not be created because of a device error.
46 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.
47 **/
48 typedef
49 EFI_STATUS
50 (EFIAPI *EFI_CREDENTIAL_ENROLL)(
51 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
52 IN EFI_USER_PROFILE_HANDLE User
53 );
54
55 /**
56 Returns the user interface information used during user identification.
57
58 This function returns information about the form used when interacting with the user during user
59 identification. The form is the first enabled form in the form-set class
60 EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If
61 the user credential provider does not require a form to identify the user, then this function should
62 return EFI_NOT_FOUND.
63
64 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
65 @param[out] Hii On return, holds the HII database handle.
66 @param[out] FormSetId On return, holds the identifier of the form set which contains
67 the form used during user identification.
68 @param[out] FormId On return, holds the identifier of the form used during user
69 identification.
70
71 @retval EFI_SUCCESS Form returned successfully.
72 @retval EFI_NOT_FOUND Form not returned.
73 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.
74 **/
75 typedef
76 EFI_STATUS
77 (EFIAPI *EFI_CREDENTIAL_FORM)(
78 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
79 OUT EFI_HII_HANDLE *Hii,
80 OUT EFI_GUID *FormSetId,
81 OUT EFI_FORM_ID *FormId
82 );
83
84 /**
85 Returns bitmap used to describe the credential provider type.
86
87 This optional function returns a bitmap which is less than or equal to the number of pixels specified
88 by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND is returned.
89
90 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
91 @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no bitmap
92 information will be returned. On exit, points to the width of the
93 bitmap returned.
94 @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no bitmap
95 information will be returned. On exit, points to the height of the
96 bitmap returned
97 @param[out] Hii On return, holds the HII database handle.
98 @param[out] Image On return, holds the HII image identifier.
99
100 @retval EFI_SUCCESS Image identifier returned successfully.
101 @retval EFI_NOT_FOUND Image identifier not returned.
102 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.
103 **/
104 typedef
105 EFI_STATUS
106 (EFIAPI *EFI_CREDENTIAL_TILE)(
107 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
108 IN OUT UINTN *Width,
109 IN OUT UINTN *Height,
110 OUT EFI_HII_HANDLE *Hii,
111 OUT EFI_IMAGE_ID *Image
112 );
113
114 /**
115 Returns string used to describe the credential provider type.
116
117 This function returns a string which describes the credential provider. If no such string exists, then
118 EFI_NOT_FOUND is returned.
119
120 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
121 @param[out] Hii On return, holds the HII database handle.
122 @param[out] String On return, holds the HII string identifier.
123
124 @retval EFI_SUCCESS String identifier returned successfully.
125 @retval EFI_NOT_FOUND String identifier not returned.
126 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.
127 **/
128 typedef
129 EFI_STATUS
130 (EFIAPI *EFI_CREDENTIAL_TITLE)(
131 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
132 OUT EFI_HII_HANDLE *Hii,
133 OUT EFI_STRING_ID *String
134 );
135
136 /**
137 Return the user identifier associated with the currently authenticated user.
138
139 This function returns the user identifier of the user authenticated by this credential provider. This
140 function is called after the credential-related information has been submitted on a form OR after a
141 call to Default() has returned that this credential is ready to log on.
142
143 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
144 @param[in] User The user profile handle of the user profile currently being considered
145 by the user identity manager. If NULL, then no user profile is currently
146 under consideration.
147 @param[out] Identifier On return, points to the user identifier.
148
149 @retval EFI_SUCCESS User identifier returned successfully.
150 @retval EFI_NOT_READY No user identifier can be returned.
151 @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.
152 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be found in user
153 profile database
154 @retval EFI_INVALID_PARAMETER Identifier is NULL.
155 **/
156 typedef
157 EFI_STATUS
158 (EFIAPI *EFI_CREDENTIAL_USER)(
159 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
160 IN EFI_USER_PROFILE_HANDLE User,
161 OUT EFI_USER_INFO_IDENTIFIER *Identifier
162 );
163
164 /**
165 Indicate that user interface interaction has begun for the specified credential.
166
167 This function is called when a credential provider is selected by the user. If AutoLogon returns
168 FALSE, then the user interface will be constructed by the User Identity Manager.
169
170 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
171 @param[out] AutoLogon On return, points to the credential provider's capabilities after
172 the credential provider has been selected by the user.
173
174 @retval EFI_SUCCESS Credential provider successfully selected.
175 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
176 **/
177 typedef
178 EFI_STATUS
179 (EFIAPI *EFI_CREDENTIAL_SELECT)(
180 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
181 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
182 );
183
184 /**
185 Indicate that user interface interaction has ended for the specified credential.
186
187 This function is called when a credential provider is deselected by the user.
188
189 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
190
191 @retval EFI_SUCCESS Credential provider successfully deselected.
192 **/
193 typedef
194 EFI_STATUS
195 (EFIAPI *EFI_CREDENTIAL_DESELECT)(
196 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This
197 );
198
199 /**
200 Return the default logon behavior for this user credential.
201
202 This function reports the default login behavior regarding this credential provider.
203
204 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
205 @param[out] AutoLogon On return, holds whether the credential provider should be
206 used by default to automatically log on the user.
207
208 @retval EFI_SUCCESS Default information successfully returned.
209 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.
210 **/
211 typedef
212 EFI_STATUS
213 (EFIAPI *EFI_CREDENTIAL_DEFAULT)(
214 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
215 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
216 );
217
218 /**
219 Return information attached to the credential provider.
220
221 This function returns user information.
222
223 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
224 @param[in] UserInfo Handle of the user information data record.
225 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user
226 information. If the buffer is too small to hold the information, then
227 EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the
228 number of bytes actually required.
229 @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user
230 information.
231
232 @retval EFI_SUCCESS Information returned successfully.
233 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the user
234 information. The size required is returned in *InfoSize.
235 @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.
236 @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL.
237 **/
238 typedef
239 EFI_STATUS
240 (EFIAPI *EFI_CREDENTIAL_GET_INFO)(
241 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
242 IN EFI_USER_INFO_HANDLE UserInfo,
243 OUT EFI_USER_INFO *Info,
244 IN OUT UINTN *InfoSize
245 );
246
247 /**
248 Enumerate all of the user information records on the credential provider.
249
250 This function returns the next user information record. To retrieve the first user information record
251 handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information
252 record handle until there are no more, at which point UserInfo will point to NULL.
253
254 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.
255 @param[in,out] UserInfo On entry, points to the previous user information handle or NULL to
256 start enumeration. On exit, points to the next user information handle
257 or NULL if there is no more user information.
258
259 @retval EFI_SUCCESS User information returned.
260 @retval EFI_NOT_FOUND No more user information found.
261 @retval EFI_INVALID_PARAMETER UserInfo is NULL.
262 **/
263 typedef
264 EFI_STATUS
265 (EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)(
266 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
267 IN OUT EFI_USER_INFO_HANDLE *UserInfo
268 );
269
270 ///
271 /// This protocol provides support for a single class of credentials
272 ///
273 struct _EFI_USER_CREDENTIAL_PROTOCOL {
274 EFI_GUID Identifier; ///< Uniquely identifies this credential provider.
275 EFI_GUID Type; ///< Identifies this class of User Credential Provider.
276 EFI_CREDENTIAL_ENROLL Enroll;
277 EFI_CREDENTIAL_FORM Form;
278 EFI_CREDENTIAL_TILE Tile;
279 EFI_CREDENTIAL_TITLE Title;
280 EFI_CREDENTIAL_USER User;
281 EFI_CREDENTIAL_SELECT Select;
282 EFI_CREDENTIAL_DESELECT Deselect;
283 EFI_CREDENTIAL_DEFAULT Default;
284 EFI_CREDENTIAL_GET_INFO GetInfo;
285 EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo;
286 EFI_CREDENTIAL_CAPABILITIES Capabilities;
287 };
288
289 extern EFI_GUID gEfiUserCredentialProtocolGuid;
290
291 #endif