Debian Codegraph @

mingw-w64-headers/include/windows.security.credentials.idl

raw
1 /*
2 * Copyright (C) 2022 Mohamad Al-Jaf
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifdef __WIDL__
20 #pragma winrt ns_prefix
21 #endif
22
23 import "inspectable.idl";
24 import "asyncinfo.idl";
25 import "eventtoken.idl";
26 import "windowscontracts.idl";
27 import "windows.foundation.idl";
28 import "windows.security.cryptography.core.idl";
29 import "windows.storage.streams.idl";
30 import "windows.system.idl";
31
32 namespace Windows.Security.Cryptography.Core {
33 typedef enum CryptographicPublicKeyBlobType CryptographicPublicKeyBlobType;
34 }
35
36 namespace Windows.Security.Credentials {
37 typedef enum KeyCredentialAttestationStatus KeyCredentialAttestationStatus;
38 typedef enum KeyCredentialCreationOption KeyCredentialCreationOption;
39 typedef enum KeyCredentialStatus KeyCredentialStatus;
40
41 interface IKeyCredential;
42 interface IKeyCredentialAttestationResult;
43 interface IKeyCredentialManagerStatics;
44 interface IKeyCredentialOperationResult;
45 interface IKeyCredentialRetrievalResult;
46
47 runtimeclass KeyCredential;
48 runtimeclass KeyCredentialAttestationResult;
49 runtimeclass KeyCredentialManager;
50 runtimeclass KeyCredentialOperationResult;
51 runtimeclass KeyCredentialRetrievalResult;
52
53 declare {
54 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Security.Credentials.KeyCredentialAttestationResult *>;
55 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Security.Credentials.KeyCredentialOperationResult *>;
56 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Security.Credentials.KeyCredentialRetrievalResult *>;
57 interface Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialAttestationResult *>;
58 interface Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialOperationResult *>;
59 interface Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialRetrievalResult *>;
60 }
61
62 [
63 contract(Windows.Foundation.UniversalApiContract, 1.0)
64 ]
65 enum KeyCredentialAttestationStatus
66 {
67 Success = 0,
68 UnknownError = 1,
69 NotSupported = 2,
70 TemporaryFailure = 3,
71 };
72
73 [
74 contract(Windows.Foundation.UniversalApiContract, 1.0)
75 ]
76 enum KeyCredentialCreationOption
77 {
78 ReplaceExisting = 0,
79 FailIfExists = 1,
80 };
81
82 [
83 contract(Windows.Foundation.UniversalApiContract, 1.0)
84 ]
85 enum KeyCredentialStatus
86 {
87 Success = 0,
88 UnknownError = 1,
89 NotFound = 2,
90 UserCanceled = 3,
91 UserPrefersPassword = 4,
92 CredentialAlreadyExists = 5,
93 SecurityDeviceLocked = 6,
94 };
95
96 [
97 contract(Windows.Foundation.UniversalApiContract, 1.0),
98 exclusiveto(Windows.Security.Credentials.KeyCredential),
99 uuid(9585ef8d-457b-4847-b11a-fa960bbdb138)
100 ]
101 interface IKeyCredential : IInspectable
102 {
103 [propget] HRESULT Name([out, retval] HSTRING *value);
104 [overload("RetrievePublicKey")] HRESULT RetrievePublicKeyWithDefaultBlobType([out, retval] Windows.Storage.Streams.IBuffer **value);
105 [overload("RetrievePublicKey")] HRESULT RetrievePublicKeyWithBlobType([in] Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType blobType, [out, retval] Windows.Storage.Streams.IBuffer **value);
106 HRESULT RequestSignAsync([in] Windows.Storage.Streams.IBuffer *data, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialOperationResult *> **value);
107 HRESULT GetAttestationAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialAttestationResult *> **value);
108 }
109
110 [
111 contract(Windows.Foundation.UniversalApiContract, 1.0),
112 exclusiveto(Windows.Security.Credentials.KeyCredentialAttestationResult),
113 uuid(78aab3a1-a3c1-4103-b6cc-472c44171cbb)
114 ]
115 interface IKeyCredentialAttestationResult : IInspectable
116 {
117 [propget] HRESULT CertificateChainBuffer([out, retval] Windows.Storage.Streams.IBuffer **value);
118 [propget] HRESULT AttestationBuffer([out, retval] Windows.Storage.Streams.IBuffer **value);
119 [propget] HRESULT Status([out, retval] Windows.Security.Credentials.KeyCredentialAttestationStatus *value);
120 }
121
122 [
123 contract(Windows.Foundation.UniversalApiContract, 1.0),
124 exclusiveto(Windows.Security.Credentials.KeyCredentialManager),
125 uuid(6aac468b-0ef1-4ce0-8290-4106da6a63b5)
126 ]
127 interface IKeyCredentialManagerStatics : IInspectable
128 {
129 HRESULT IsSupportedAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **value);
130 HRESULT RenewAttestationAsync([out, retval] Windows.Foundation.IAsyncAction **operation);
131 HRESULT RequestCreateAsync(HSTRING name, Windows.Security.Credentials.KeyCredentialCreationOption option,
132 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialRetrievalResult *> **value);
133 HRESULT OpenAsync(HSTRING name, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCredentialRetrievalResult *> **value);
134 HRESULT DeleteAsync(HSTRING name, [out, retval] Windows.Foundation.IAsyncAction **operation);
135 }
136
137 [
138 contract(Windows.Foundation.UniversalApiContract, 1.0),
139 exclusiveto(Windows.Security.Credentials.KeyCredentialOperationResult),
140 uuid(f53786c1-5261-4cdd-976d-cc909ac71620)
141 ]
142 interface IKeyCredentialOperationResult : IInspectable
143 {
144 [propget] HRESULT Result([out, retval] Windows.Storage.Streams.IBuffer **value);
145 [propget] HRESULT Status([out, retval] Windows.Security.Credentials.KeyCredentialStatus *value);
146 }
147
148 [
149 contract(Windows.Foundation.UniversalApiContract, 1.0),
150 exclusiveto(Windows.Security.Credentials.KeyCredentialRetrievalResult),
151 uuid(58cd7703-8d87-4249-9b58-f6598cc9644e)
152 ]
153 interface IKeyCredentialRetrievalResult : IInspectable
154 {
155 [propget] HRESULT Credential([out, retval] Windows.Security.Credentials.KeyCredential **value);
156 [propget] HRESULT Status([out, retval] Windows.Security.Credentials.KeyCredentialStatus *value);
157 }
158
159 [
160 contract(Windows.Foundation.UniversalApiContract, 1.0),
161 marshaling_behavior(agile)
162 ]
163 runtimeclass KeyCredential
164 {
165 [default] interface Windows.Security.Credentials.IKeyCredential;
166 }
167
168 [
169 contract(Windows.Foundation.UniversalApiContract, 1.0),
170 marshaling_behavior(agile)
171 ]
172 runtimeclass KeyCredentialAttestationResult
173 {
174 [default] interface Windows.Security.Credentials.IKeyCredentialAttestationResult;
175 }
176
177 [
178 contract(Windows.Foundation.UniversalApiContract, 1.0),
179 marshaling_behavior(agile),
180 static(Windows.Security.Credentials.IKeyCredentialManagerStatics, Windows.Foundation.UniversalApiContract, 1.0),
181 threading(both)
182 ]
183 runtimeclass KeyCredentialManager
184 {
185 }
186
187 [
188 contract(Windows.Foundation.UniversalApiContract, 1.0),
189 marshaling_behavior(agile)
190 ]
191 runtimeclass KeyCredentialOperationResult
192 {
193 [default] interface Windows.Security.Credentials.IKeyCredentialOperationResult;
194 }
195
196 [
197 contract(Windows.Foundation.UniversalApiContract, 1.0),
198 marshaling_behavior(agile)
199 ]
200 runtimeclass KeyCredentialRetrievalResult
201 {
202 [default] interface Windows.Security.Credentials.IKeyCredentialRetrievalResult;
203 }
204 }