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:))]
30 #[unsafe(method_family = init)]
31 pub unsafe fn initWithObjectID(
32 this: Allocated<Self>,
33 object_id: &TKTokenObjectID,
34 ) -> Retained<Self>;
35
36 #[unsafe(method(init))]
37 #[unsafe(method_family = init)]
38 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40 #[cfg(feature = "TKToken")]
41 #[unsafe(method(objectID))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn objectID(&self) -> Retained<TKTokenObjectID>;
45
46 #[unsafe(method(label))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn label(&self) -> Option<Retained<NSString>>;
50
51 #[unsafe(method(setLabel:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn setLabel(&self, label: Option<&NSString>);
55
56 #[cfg(feature = "TKToken")]
57 #[unsafe(method(constraints))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn constraints(
61 &self,
62 ) -> Option<Retained<NSDictionary<NSNumber, TKTokenOperationConstraint>>>;
63
64 #[cfg(feature = "TKToken")]
65 #[unsafe(method(setConstraints:))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn setConstraints(
69 &self,
70 constraints: Option<&NSDictionary<NSNumber, TKTokenOperationConstraint>>,
71 );
72 );
73}
74
75impl TKTokenKeychainItem {
77 extern_methods!(
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new() -> Retained<Self>;
81 );
82}
83
84extern_class!(
85 #[unsafe(super(TKTokenKeychainItem, NSObject))]
89 #[derive(Debug, PartialEq, Eq, Hash)]
90 pub struct TKTokenKeychainCertificate;
91);
92
93extern_conformance!(
94 unsafe impl NSObjectProtocol for TKTokenKeychainCertificate {}
95);
96
97impl TKTokenKeychainCertificate {
98 extern_methods!(
99 #[cfg(all(feature = "TKToken", feature = "objc2-security"))]
100 #[unsafe(method(initWithCertificate:objectID:))]
103 #[unsafe(method_family = init)]
104 pub unsafe fn initWithCertificate_objectID(
105 this: Allocated<Self>,
106 certificate_ref: &SecCertificate,
107 object_id: &TKTokenObjectID,
108 ) -> Option<Retained<Self>>;
109
110 #[cfg(feature = "TKToken")]
111 #[unsafe(method(initWithObjectID:))]
112 #[unsafe(method_family = init)]
113 pub unsafe fn initWithObjectID(
114 this: Allocated<Self>,
115 object_id: &TKTokenObjectID,
116 ) -> Retained<Self>;
117
118 #[unsafe(method(data))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn data(&self) -> Retained<NSData>;
122 );
123}
124
125impl TKTokenKeychainCertificate {
127 extern_methods!(
128 #[unsafe(method(init))]
129 #[unsafe(method_family = init)]
130 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
131 );
132}
133
134impl TKTokenKeychainCertificate {
136 extern_methods!(
137 #[unsafe(method(new))]
138 #[unsafe(method_family = new)]
139 pub unsafe fn new() -> Retained<Self>;
140 );
141}
142
143extern_class!(
144 #[unsafe(super(TKTokenKeychainItem, NSObject))]
148 #[derive(Debug, PartialEq, Eq, Hash)]
149 pub struct TKTokenKeychainKey;
150);
151
152extern_conformance!(
153 unsafe impl NSObjectProtocol for TKTokenKeychainKey {}
154);
155
156impl TKTokenKeychainKey {
157 extern_methods!(
158 #[cfg(all(feature = "TKToken", feature = "objc2-security"))]
159 #[unsafe(method(initWithCertificate:objectID:))]
161 #[unsafe(method_family = init)]
162 pub unsafe fn initWithCertificate_objectID(
163 this: Allocated<Self>,
164 certificate_ref: Option<&SecCertificate>,
165 object_id: &TKTokenObjectID,
166 ) -> Option<Retained<Self>>;
167
168 #[cfg(feature = "TKToken")]
169 #[unsafe(method(initWithObjectID:))]
170 #[unsafe(method_family = init)]
171 pub unsafe fn initWithObjectID(
172 this: Allocated<Self>,
173 object_id: &TKTokenObjectID,
174 ) -> Retained<Self>;
175
176 #[unsafe(method(keyType))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn keyType(&self) -> Retained<NSString>;
180
181 #[unsafe(method(setKeyType:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn setKeyType(&self, key_type: &NSString);
185
186 #[unsafe(method(applicationTag))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn applicationTag(&self) -> Option<Retained<NSData>>;
190
191 #[unsafe(method(setApplicationTag:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn setApplicationTag(&self, application_tag: Option<&NSData>);
195
196 #[unsafe(method(keySizeInBits))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn keySizeInBits(&self) -> NSInteger;
200
201 #[unsafe(method(setKeySizeInBits:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn setKeySizeInBits(&self, key_size_in_bits: NSInteger);
205
206 #[unsafe(method(publicKeyData))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn publicKeyData(&self) -> Option<Retained<NSData>>;
210
211 #[unsafe(method(setPublicKeyData:))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn setPublicKeyData(&self, public_key_data: Option<&NSData>);
215
216 #[unsafe(method(publicKeyHash))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn publicKeyHash(&self) -> Option<Retained<NSData>>;
220
221 #[unsafe(method(setPublicKeyHash:))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn setPublicKeyHash(&self, public_key_hash: Option<&NSData>);
225
226 #[unsafe(method(canDecrypt))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn canDecrypt(&self) -> bool;
230
231 #[unsafe(method(setCanDecrypt:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setCanDecrypt(&self, can_decrypt: bool);
235
236 #[unsafe(method(canSign))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn canSign(&self) -> bool;
240
241 #[unsafe(method(setCanSign:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn setCanSign(&self, can_sign: bool);
245
246 #[unsafe(method(canPerformKeyExchange))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn canPerformKeyExchange(&self) -> bool;
250
251 #[unsafe(method(setCanPerformKeyExchange:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn setCanPerformKeyExchange(&self, can_perform_key_exchange: bool);
255
256 #[unsafe(method(isSuitableForLogin))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn isSuitableForLogin(&self) -> bool;
260
261 #[unsafe(method(setSuitableForLogin:))]
263 #[unsafe(method_family = none)]
264 pub unsafe fn setSuitableForLogin(&self, suitable_for_login: bool);
265 );
266}
267
268impl TKTokenKeychainKey {
270 extern_methods!(
271 #[unsafe(method(init))]
272 #[unsafe(method_family = init)]
273 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
274 );
275}
276
277impl TKTokenKeychainKey {
279 extern_methods!(
280 #[unsafe(method(new))]
281 #[unsafe(method_family = new)]
282 pub unsafe fn new() -> Retained<Self>;
283 );
284}
285
286extern_class!(
287 #[unsafe(super(NSObject))]
291 #[derive(Debug, PartialEq, Eq, Hash)]
292 pub struct TKTokenKeychainContents;
293);
294
295extern_conformance!(
296 unsafe impl NSObjectProtocol for TKTokenKeychainContents {}
297);
298
299impl TKTokenKeychainContents {
300 extern_methods!(
301 #[unsafe(method(fillWithItems:))]
305 #[unsafe(method_family = none)]
306 pub unsafe fn fillWithItems(&self, items: &NSArray<TKTokenKeychainItem>);
307
308 #[unsafe(method(items))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn items(&self) -> Retained<NSArray<TKTokenKeychainItem>>;
312
313 #[cfg(feature = "TKToken")]
314 #[unsafe(method(keyForObjectID:error:_))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn keyForObjectID_error(
318 &self,
319 object_id: &TKTokenObjectID,
320 ) -> Result<Retained<TKTokenKeychainKey>, Retained<NSError>>;
321
322 #[cfg(feature = "TKToken")]
323 #[unsafe(method(certificateForObjectID:error:_))]
325 #[unsafe(method_family = none)]
326 pub unsafe fn certificateForObjectID_error(
327 &self,
328 object_id: &TKTokenObjectID,
329 ) -> Result<Retained<TKTokenKeychainCertificate>, Retained<NSError>>;
330
331 #[unsafe(method(init))]
332 #[unsafe(method_family = init)]
333 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
334 );
335}
336
337impl TKTokenKeychainContents {
339 extern_methods!(
340 #[unsafe(method(new))]
341 #[unsafe(method_family = new)]
342 pub unsafe fn new() -> Retained<Self>;
343 );
344}