objc2_crypto_token_kit/generated/
TKTokenKeychainItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-security")]
8use objc2_security::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct TKTokenKeychainItem;
19);
20
21extern_conformance!(
22 unsafe impl NSObjectProtocol for TKTokenKeychainItem {}
23);
24
25impl TKTokenKeychainItem {
26 extern_methods!(
27 #[cfg(feature = "TKToken")]
28 #[unsafe(method(initWithObjectID:))]
34 #[unsafe(method_family = init)]
35 pub unsafe fn initWithObjectID(
36 this: Allocated<Self>,
37 object_id: &TKTokenObjectID,
38 ) -> Retained<Self>;
39
40 #[unsafe(method(init))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
43
44 #[cfg(feature = "TKToken")]
45 #[unsafe(method(objectID))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn objectID(&self) -> Retained<TKTokenObjectID>;
49
50 #[unsafe(method(label))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn label(&self) -> Option<Retained<NSString>>;
54
55 #[unsafe(method(setLabel:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setLabel(&self, label: Option<&NSString>);
61
62 #[cfg(feature = "TKToken")]
63 #[unsafe(method(constraints))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn constraints(
67 &self,
68 ) -> Option<Retained<NSDictionary<NSNumber, TKTokenOperationConstraint>>>;
69
70 #[cfg(feature = "TKToken")]
71 #[unsafe(method(setConstraints:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setConstraints(
81 &self,
82 constraints: Option<&NSDictionary<NSNumber, TKTokenOperationConstraint>>,
83 );
84 );
85}
86
87impl TKTokenKeychainItem {
89 extern_methods!(
90 #[unsafe(method(new))]
91 #[unsafe(method_family = new)]
92 pub unsafe fn new() -> Retained<Self>;
93 );
94}
95
96extern_class!(
97 #[unsafe(super(TKTokenKeychainItem, NSObject))]
101 #[derive(Debug, PartialEq, Eq, Hash)]
102 pub struct TKTokenKeychainCertificate;
103);
104
105extern_conformance!(
106 unsafe impl NSObjectProtocol for TKTokenKeychainCertificate {}
107);
108
109impl TKTokenKeychainCertificate {
110 extern_methods!(
111 #[cfg(all(feature = "TKToken", feature = "objc2-security"))]
112 #[unsafe(method(initWithCertificate:objectID:))]
119 #[unsafe(method_family = init)]
120 pub unsafe fn initWithCertificate_objectID(
121 this: Allocated<Self>,
122 certificate_ref: &SecCertificate,
123 object_id: &TKTokenObjectID,
124 ) -> Option<Retained<Self>>;
125
126 #[cfg(feature = "TKToken")]
127 #[unsafe(method(initWithObjectID:))]
131 #[unsafe(method_family = init)]
132 pub unsafe fn initWithObjectID(
133 this: Allocated<Self>,
134 object_id: &TKTokenObjectID,
135 ) -> Retained<Self>;
136
137 #[unsafe(method(data))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn data(&self) -> Retained<NSData>;
141 );
142}
143
144impl TKTokenKeychainCertificate {
146 extern_methods!(
147 #[unsafe(method(init))]
148 #[unsafe(method_family = init)]
149 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150 );
151}
152
153impl TKTokenKeychainCertificate {
155 extern_methods!(
156 #[unsafe(method(new))]
157 #[unsafe(method_family = new)]
158 pub unsafe fn new() -> Retained<Self>;
159 );
160}
161
162extern_class!(
163 #[unsafe(super(TKTokenKeychainItem, NSObject))]
167 #[derive(Debug, PartialEq, Eq, Hash)]
168 pub struct TKTokenKeychainKey;
169);
170
171extern_conformance!(
172 unsafe impl NSObjectProtocol for TKTokenKeychainKey {}
173);
174
175impl TKTokenKeychainKey {
176 extern_methods!(
177 #[cfg(all(feature = "TKToken", feature = "objc2-security"))]
178 #[unsafe(method(initWithCertificate:objectID:))]
184 #[unsafe(method_family = init)]
185 pub unsafe fn initWithCertificate_objectID(
186 this: Allocated<Self>,
187 certificate_ref: Option<&SecCertificate>,
188 object_id: &TKTokenObjectID,
189 ) -> Option<Retained<Self>>;
190
191 #[cfg(feature = "TKToken")]
192 #[unsafe(method(initWithObjectID:))]
196 #[unsafe(method_family = init)]
197 pub unsafe fn initWithObjectID(
198 this: Allocated<Self>,
199 object_id: &TKTokenObjectID,
200 ) -> Retained<Self>;
201
202 #[unsafe(method(keyType))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn keyType(&self) -> Retained<NSString>;
206
207 #[unsafe(method(setKeyType:))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn setKeyType(&self, key_type: &NSString);
213
214 #[unsafe(method(applicationTag))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn applicationTag(&self) -> Option<Retained<NSData>>;
218
219 #[unsafe(method(setApplicationTag:))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn setApplicationTag(&self, application_tag: Option<&NSData>);
225
226 #[unsafe(method(keySizeInBits))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn keySizeInBits(&self) -> NSInteger;
230
231 #[unsafe(method(setKeySizeInBits:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setKeySizeInBits(&self, key_size_in_bits: NSInteger);
235
236 #[unsafe(method(publicKeyData))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn publicKeyData(&self) -> Option<Retained<NSData>>;
240
241 #[unsafe(method(setPublicKeyData:))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn setPublicKeyData(&self, public_key_data: Option<&NSData>);
247
248 #[unsafe(method(publicKeyHash))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn publicKeyHash(&self) -> Option<Retained<NSData>>;
252
253 #[unsafe(method(setPublicKeyHash:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn setPublicKeyHash(&self, public_key_hash: Option<&NSData>);
259
260 #[unsafe(method(canDecrypt))]
262 #[unsafe(method_family = none)]
263 pub unsafe fn canDecrypt(&self) -> bool;
264
265 #[unsafe(method(setCanDecrypt:))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn setCanDecrypt(&self, can_decrypt: bool);
269
270 #[unsafe(method(canSign))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn canSign(&self) -> bool;
274
275 #[unsafe(method(setCanSign:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn setCanSign(&self, can_sign: bool);
279
280 #[unsafe(method(canPerformKeyExchange))]
282 #[unsafe(method_family = none)]
283 pub unsafe fn canPerformKeyExchange(&self) -> bool;
284
285 #[unsafe(method(setCanPerformKeyExchange:))]
287 #[unsafe(method_family = none)]
288 pub unsafe fn setCanPerformKeyExchange(&self, can_perform_key_exchange: bool);
289
290 #[unsafe(method(isSuitableForLogin))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn isSuitableForLogin(&self) -> bool;
294
295 #[unsafe(method(setSuitableForLogin:))]
297 #[unsafe(method_family = none)]
298 pub unsafe fn setSuitableForLogin(&self, suitable_for_login: bool);
299 );
300}
301
302impl TKTokenKeychainKey {
304 extern_methods!(
305 #[unsafe(method(init))]
306 #[unsafe(method_family = init)]
307 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
308 );
309}
310
311impl TKTokenKeychainKey {
313 extern_methods!(
314 #[unsafe(method(new))]
315 #[unsafe(method_family = new)]
316 pub unsafe fn new() -> Retained<Self>;
317 );
318}
319
320extern_class!(
321 #[unsafe(super(NSObject))]
325 #[derive(Debug, PartialEq, Eq, Hash)]
326 pub struct TKTokenKeychainContents;
327);
328
329extern_conformance!(
330 unsafe impl NSObjectProtocol for TKTokenKeychainContents {}
331);
332
333impl TKTokenKeychainContents {
334 extern_methods!(
335 #[unsafe(method(fillWithItems:))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn fillWithItems(&self, items: &NSArray<TKTokenKeychainItem>);
341
342 #[unsafe(method(items))]
344 #[unsafe(method_family = none)]
345 pub unsafe fn items(&self) -> Retained<NSArray<TKTokenKeychainItem>>;
346
347 #[cfg(feature = "TKToken")]
348 #[unsafe(method(keyForObjectID:error:_))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn keyForObjectID_error(
356 &self,
357 object_id: &TKTokenObjectID,
358 ) -> Result<Retained<TKTokenKeychainKey>, Retained<NSError>>;
359
360 #[cfg(feature = "TKToken")]
361 #[unsafe(method(certificateForObjectID:error:_))]
367 #[unsafe(method_family = none)]
368 pub unsafe fn certificateForObjectID_error(
369 &self,
370 object_id: &TKTokenObjectID,
371 ) -> Result<Retained<TKTokenKeychainCertificate>, Retained<NSError>>;
372
373 #[unsafe(method(init))]
374 #[unsafe(method_family = init)]
375 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
376 );
377}
378
379impl TKTokenKeychainContents {
381 extern_methods!(
382 #[unsafe(method(new))]
383 #[unsafe(method_family = new)]
384 pub unsafe fn new() -> Retained<Self>;
385 );
386}