objc2_local_authentication/generated/LAContext.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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
12/// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/lapolicy?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct LAPolicy(pub NSInteger);
17impl LAPolicy {
18 /// Device owner will be authenticated using a biometric method (Touch ID).
19 ///
20 ///
21 /// Biometric authentication is required. If Touch ID is not available, not enrolled
22 /// or locked out, then the evaluation of this policy will fail with LAErrorBiometryNotAvailable,
23 /// LAErrorBiometryNotEnrolled or LAErrorBiometryLockout.
24 ///
25 /// Touch ID authentication dialog contains a cancel button with default title "Cancel"
26 /// which can be customized using localizedCancelTitle property, and a fallback button with
27 /// default title "Use Password…" which can be customized using localizedFallbackTitle
28 /// property. Clicking either button causes evaluatePolicy call to fail, returning a distinct
29 /// error code: LAErrorUserCancel or LAErrorUserFallback.
30 ///
31 /// Biometric authentication will get locked after 5 unsuccessful attempts. After that,
32 /// users have to unlock it by entering their account password. The password can be entered
33 /// either at login window or in the preference sheets or even in application by the means of
34 /// LAPolicyDeviceOwnerAuthentication. The system unlock is preferred user experience because
35 /// we generaly don't want users to enter their account password at application's request.
36 #[doc(alias = "LAPolicyDeviceOwnerAuthenticationWithBiometrics")]
37 pub const DeviceOwnerAuthenticationWithBiometrics: Self = Self(1);
38 /// Device owner will be authenticated by biometry or user password.
39 ///
40 ///
41 /// Touch ID or user password authentication is required. If Touch ID is not available,
42 /// not enrolled or locked out, then the user is asked for password right away.
43 ///
44 /// Touch ID authentication dialog behaves similarly as the one used by
45 /// LAPolicyDeviceOwnerAuthenticationWithBiometrics. However, the "Use Password.." button does
46 /// not end the authentication. Instead, it switches the authentication mechanism to user password.
47 #[doc(alias = "LAPolicyDeviceOwnerAuthentication")]
48 pub const DeviceOwnerAuthentication: Self = Self(2);
49 /// Device owner will be authenticated by Watch.
50 ///
51 ///
52 /// Watch authentication is required. If no nearby paired watch device can be found,
53 /// LAErrorWatchNotAvailable is returned.
54 ///
55 /// Watch authentication dialog looks and behaves similarly to the biometric variant. Users can
56 /// confirm authentication by double-clicking the side button on their watch.
57 #[doc(alias = "LAPolicyDeviceOwnerAuthenticationWithWatch")]
58 #[deprecated]
59 pub const DeviceOwnerAuthenticationWithWatch: Self = Self(3);
60 /// Device owner will be authenticated by a companion device e.g. Watch, Mac, etc.
61 ///
62 ///
63 /// Companion authentication is required. If no nearby paired companion device can be found,
64 /// LAErrorCompanionNotAvailable is returned.
65 ///
66 /// Users should follow instructions on the companion device to authenticate.
67 #[doc(alias = "LAPolicyDeviceOwnerAuthenticationWithCompanion")]
68 pub const DeviceOwnerAuthenticationWithCompanion: Self = Self(3);
69 /// Device owner will be authenticated by biometry or Watch.
70 ///
71 ///
72 /// Watch or biometric authentication is required. If no nearby paired watch device can be found,
73 /// it behaves as LAPolicyDeviceOwnerAuthenticationWithBiometrics. Similarly, if biometry is
74 /// unavailable it behaves as LAPolicyDeviceOwnerAuthenticationWithWatch.
75 ///
76 /// Watch authentication dialog looks and behaves similarly to biometric variant. When both
77 /// mechanisms are available, user is asked to use biometry and watch authentication will run in
78 /// parallel.
79 #[doc(alias = "LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch")]
80 #[deprecated]
81 pub const DeviceOwnerAuthenticationWithBiometricsOrWatch: Self = Self(4);
82 /// Device owner will be authenticated by biometry or a companion device e.g. Watch, Mac, etc.
83 ///
84 ///
85 /// Companion or biometric authentication is required. If no nearby paired companion device can be found,
86 /// it behaves as LAPolicyDeviceOwnerAuthenticationWithBiometrics. Similarly, if biometry is
87 /// unavailable it behaves as LAPolicyDeviceOwnerAuthenticationWithCompanion.
88 ///
89 /// When both mechanisms are available, user is asked to use biometry and companion authentication
90 /// will run in parallel. Users should follow instructions on the companion device to authenticate.
91 #[doc(alias = "LAPolicyDeviceOwnerAuthenticationWithBiometricsOrCompanion")]
92 pub const DeviceOwnerAuthenticationWithBiometricsOrCompanion: Self = Self(4);
93 /// Device owner will be authenticated by device passcode. The authentication will also succeed if the wrist detection is enabled,
94 /// correct passcode was entered in the past and the watch has been on the wrist ever since.
95 #[doc(alias = "LAPolicyDeviceOwnerAuthenticationWithWristDetection")]
96 pub const DeviceOwnerAuthenticationWithWristDetection: Self = Self(5);
97}
98
99unsafe impl Encode for LAPolicy {
100 const ENCODING: Encoding = NSInteger::ENCODING;
101}
102
103unsafe impl RefEncode for LAPolicy {
104 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
105}
106
107extern "C" {
108 /// The maximum value for LAContext touchIDAuthenticationAllowableReuseDuration property.
109 ///
110 /// See also [Apple's documentation](https://developer.apple.com/documentation/localauthentication/latouchidauthenticationmaximumallowablereuseduration?language=objc)
111 pub static LATouchIDAuthenticationMaximumAllowableReuseDuration: NSTimeInterval;
112}
113
114/// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/lacredentialtype?language=objc)
115// NS_ENUM
116#[repr(transparent)]
117#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
118pub struct LACredentialType(pub NSInteger);
119impl LACredentialType {
120 /// Password provided by application
121 ///
122 ///
123 /// If not set, LocalAuthentication will ask for the password when necessary. It will use
124 /// its own user interface depending on the evaluated policy or ACL.
125 /// Applications can provide the password using the setCredential method. In such case,
126 /// LocalAuthentication will not show password entry user interface.
127 /// When entered from the LocalAuthentication user interface, the password is stored as
128 /// UTF-8 encoded string.
129 #[doc(alias = "LACredentialTypeApplicationPassword")]
130 pub const ApplicationPassword: Self = Self(0);
131 /// Smart card PIN provided by application
132 ///
133 ///
134 /// If not set, LocalAuthentication will ask users for the smart card PIN when necessary.
135 /// Applications can provide the PIN using setCredential method. In such case,
136 /// LocalAuthentication will not show the smart card PIN user interface.
137 /// When entered from the LocalAuthentication user interface, the PIN is stored as
138 /// UTF-8 encoded string.
139 #[doc(alias = "LACredentialTypeSmartCardPIN")]
140 pub const SmartCardPIN: Self = Self(-3);
141}
142
143unsafe impl Encode for LACredentialType {
144 const ENCODING: Encoding = NSInteger::ENCODING;
145}
146
147unsafe impl RefEncode for LACredentialType {
148 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
149}
150
151/// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/laaccesscontroloperation?language=objc)
152// NS_ENUM
153#[repr(transparent)]
154#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
155pub struct LAAccessControlOperation(pub NSInteger);
156impl LAAccessControlOperation {
157 /// Access control will be used for item creation.
158 #[doc(alias = "LAAccessControlOperationCreateItem")]
159 pub const CreateItem: Self = Self(0);
160 /// Access control will be used for accessing existing item.
161 #[doc(alias = "LAAccessControlOperationUseItem")]
162 pub const UseItem: Self = Self(1);
163 /// Access control will be used for key creation.
164 #[doc(alias = "LAAccessControlOperationCreateKey")]
165 pub const CreateKey: Self = Self(2);
166 /// Access control will be used for sign operation with existing key.
167 #[doc(alias = "LAAccessControlOperationUseKeySign")]
168 pub const UseKeySign: Self = Self(3);
169 /// Access control will be used for data decryption using existing key.
170 #[doc(alias = "LAAccessControlOperationUseKeyDecrypt")]
171 pub const UseKeyDecrypt: Self = Self(4);
172 /// Access control will be used for key exchange.
173 #[doc(alias = "LAAccessControlOperationUseKeyKeyExchange")]
174 pub const UseKeyKeyExchange: Self = Self(5);
175}
176
177unsafe impl Encode for LAAccessControlOperation {
178 const ENCODING: Encoding = NSInteger::ENCODING;
179}
180
181unsafe impl RefEncode for LAAccessControlOperation {
182 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
183}
184
185extern_class!(
186 /// Class that represents an authentication context.
187 ///
188 ///
189 /// This context can be used for evaluating policies.
190 ///
191 ///
192 /// See: LAPolicy
193 ///
194 /// See also [Apple's documentation](https://developer.apple.com/documentation/localauthentication/lacontext?language=objc)
195 #[unsafe(super(NSObject))]
196 #[derive(Debug, PartialEq, Eq, Hash)]
197 pub struct LAContext;
198);
199
200extern_conformance!(
201 unsafe impl NSObjectProtocol for LAContext {}
202);
203
204impl LAContext {
205 extern_methods!(
206 /// Determines if a particular policy can be evaluated.
207 ///
208 ///
209 /// Policies can have certain requirements which, when not satisfied, would always cause
210 /// the policy evaluation to fail - e.g. a passcode set, a fingerprint
211 /// enrolled with Touch ID or a face set up with Face ID. This method allows easy checking
212 /// for such conditions.
213 ///
214 /// Applications should consume the returned value immediately and avoid relying on it
215 /// for an extensive period of time. At least, it is guaranteed to stay valid until the
216 /// application enters background.
217 ///
218 ///
219 /// Warning: Do not call this method in the reply block of evaluatePolicy:reply: because it could
220 /// lead to a deadlock.
221 ///
222 ///
223 /// Parameter `policy`: Policy for which the preflight check should be run.
224 ///
225 ///
226 /// Parameter `error`: Optional output parameter which is set to nil if the policy can be evaluated, or it
227 /// contains error information if policy evaluation is not possible.
228 ///
229 ///
230 /// Returns: YES if the policy can be evaluated, NO otherwise.
231 #[unsafe(method(canEvaluatePolicy:error:_))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn canEvaluatePolicy_error(
234 &self,
235 policy: LAPolicy,
236 ) -> Result<(), Retained<NSError>>;
237
238 #[cfg(feature = "block2")]
239 /// Evaluates the specified policy.
240 ///
241 ///
242 /// Policy evaluation may involve prompting user for various kinds of interaction
243 /// or authentication. Actual behavior is dependent on evaluated policy, device type,
244 /// and can be affected by installed configuration profiles.
245 ///
246 /// Be sure to keep a strong reference to the context while the evaluation is in progress.
247 /// Otherwise, an evaluation would be canceled when the context is being deallocated.
248 ///
249 /// The method does not block. Instead, the caller must provide a reply block to be
250 /// called asynchronously when evaluation finishes. The block is executed on a private
251 /// queue internal to the framework in an unspecified threading context. Other than that,
252 /// no guarantee is made about which queue, thread, or run-loop the block is executed on.
253 ///
254 /// Implications of successful policy evaluation are policy specific. In general, this
255 /// operation is not idempotent. Policy evaluation may fail for various reasons, including
256 /// user cancel, system cancel and others, see LAError codes.
257 ///
258 ///
259 /// Parameter `policy`: Policy to be evaluated.
260 ///
261 ///
262 /// Parameter `reply`: Reply block that is executed when policy evaluation finishes.
263 /// success Reply parameter that is YES if the policy has been evaluated successfully or
264 /// NO if the evaluation failed.
265 /// error Reply parameter that is nil if the policy has been evaluated successfully, or it
266 /// contains error information about the evaluation failure.
267 ///
268 ///
269 /// Parameter `localizedReason`: Application reason for authentication. This string must be provided in correct
270 /// localization and should be short and clear. It will be eventually displayed in
271 /// the authentication dialog as a part of the following string:
272 /// "<appname>" is trying to
273 /// <localized
274 /// reason>.
275 ///
276 /// For example, if the app name is "TestApp" and localizedReason is passed "access
277 /// the hidden records", then the authentication prompt will read:
278 /// "TestApp" is trying to access the hidden records.
279 ///
280 ///
281 /// Warning: localizedReason parameter is mandatory and the call will throw NSInvalidArgumentException if
282 /// nil or empty string is specified.
283 ///
284 ///
285 /// See: LAError
286 ///
287 /// Typical error codes returned by this call are:
288 ///
289 /// LAErrorUserFallback if user tapped the fallback button
290 ///
291 /// LAErrorUserCancel if user has tapped the Cancel button
292 ///
293 /// LAErrorSystemCancel if some system event interrupted the evaluation (e.g. Home button pressed).
294 #[unsafe(method(evaluatePolicy:localizedReason:reply:))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn evaluatePolicy_localizedReason_reply(
297 &self,
298 policy: LAPolicy,
299 localized_reason: &NSString,
300 reply: &block2::DynBlock<dyn Fn(Bool, *mut NSError)>,
301 );
302
303 /// Invalidates the context.
304 ///
305 ///
306 /// The context is invalidated automatically when it is (auto)released. This method
307 /// allows invalidating it manually while it is still in scope.
308 ///
309 /// Invalidation terminates any existing policy evaluation and the respective call will
310 /// fail with LAErrorAppCancel. After the context has been invalidated, it can not be
311 /// used for policy evaluation and an attempt to do so will fail with LAErrorInvalidContext.
312 ///
313 /// Invalidating a context that has been already invalidated has no effect.
314 #[unsafe(method(invalidate))]
315 #[unsafe(method_family = none)]
316 pub unsafe fn invalidate(&self);
317
318 /// Sets a credential to this context.
319 ///
320 ///
321 /// Some policies allow to bind application-provided credential with them.
322 /// This method allows credential to be passed to the right context.
323 ///
324 ///
325 /// Parameter `credential`: Credential to be used with subsequent calls. Setting this parameter to nil will remove
326 /// any existing credential of the specified type.
327 ///
328 ///
329 /// Parameter `type`: Type of the provided credential.
330 ///
331 ///
332 /// Returns: YES if the credential was set successfully, NO otherwise.
333 #[unsafe(method(setCredential:type:))]
334 #[unsafe(method_family = none)]
335 pub unsafe fn setCredential_type(
336 &self,
337 credential: Option<&NSData>,
338 r#type: LACredentialType,
339 ) -> bool;
340
341 /// Reveals if credential was set with this context.
342 ///
343 ///
344 /// Parameter `type`: Type of credential we are asking for.
345 ///
346 ///
347 /// Returns: YES on success, NO otherwise.
348 #[unsafe(method(isCredentialSet:))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn isCredentialSet(&self, r#type: LACredentialType) -> bool;
351
352 #[cfg(all(feature = "block2", feature = "objc2-security"))]
353 /// Evaluates access control object for the specified operation.
354 ///
355 ///
356 /// Access control evaluation may involve prompting user for various kinds of interaction
357 /// or authentication. Actual behavior is dependent on evaluated access control, device type,
358 /// and can be affected by installed configuration profiles.
359 ///
360 /// Be sure to keep a strong reference to the context while the evaluation is in progress.
361 /// Otherwise, an evaluation would be canceled when the context is being deallocated.
362 ///
363 /// The method does not block. Instead, the caller must provide a reply block to be
364 /// called asynchronously when evaluation finishes. The block is executed on a private
365 /// queue internal to the framework in an unspecified threading context. Other than that,
366 /// no guarantee is made about which queue, thread, or run-loop the block is executed on.
367 ///
368 /// After successful access control evaluation, the LAContext can be used with keychain operations,
369 /// so that they do not require user to authenticate.
370 ///
371 /// Access control evaluation may fail for various reasons, including user cancel, system cancel
372 /// and others, see LAError codes.
373 ///
374 ///
375 /// Parameter `accessControl`: Access control object that is typically created by SecAccessControlCreateWithFlags.
376 ///
377 ///
378 /// Parameter `operation`: Type of operation the access control will be used with.
379 ///
380 ///
381 /// Parameter `localizedReason`: Application reason for authentication. This string must be provided in correct
382 /// localization and should be short and clear. It will be eventually displayed in
383 /// the authentication dialog as a part of the following string:
384 /// "<appname>" is trying to
385 /// <localized
386 /// reason>.
387 ///
388 /// For example, if the app name is "TestApp" and localizedReason is passed "access
389 /// the hidden records", then the authentication prompt will read:
390 /// "TestApp" is trying to access the hidden records.
391 ///
392 ///
393 /// Parameter `reply`: Reply block that is executed when access control evaluation finishes.
394 /// success Reply parameter that is YES if the access control has been evaluated successfully or
395 /// NO if the evaluation failed.
396 /// error Reply parameter that is nil if the access control has been evaluated successfully, or
397 /// it contains error information about the evaluation failure.
398 ///
399 ///
400 /// Warning: localizedReason parameter is mandatory and the call will throw NSInvalidArgumentException if
401 /// nil or empty string is specified.
402 #[unsafe(method(evaluateAccessControl:operation:localizedReason:reply:))]
403 #[unsafe(method_family = none)]
404 pub unsafe fn evaluateAccessControl_operation_localizedReason_reply(
405 &self,
406 access_control: &SecAccessControl,
407 operation: LAAccessControlOperation,
408 localized_reason: &NSString,
409 reply: &block2::DynBlock<dyn Fn(Bool, *mut NSError)>,
410 );
411
412 /// Fallback button title.
413 ///
414 /// Allows fallback button title customization. If set to empty string, the button will be hidden.
415 /// A default title "Use Password…" is used when this property is left nil.
416 #[unsafe(method(localizedFallbackTitle))]
417 #[unsafe(method_family = none)]
418 pub unsafe fn localizedFallbackTitle(&self) -> Option<Retained<NSString>>;
419
420 /// Setter for [`localizedFallbackTitle`][Self::localizedFallbackTitle].
421 #[unsafe(method(setLocalizedFallbackTitle:))]
422 #[unsafe(method_family = none)]
423 pub unsafe fn setLocalizedFallbackTitle(&self, localized_fallback_title: Option<&NSString>);
424
425 /// This property is deprecated and setting it has no effect.
426 #[deprecated = "No longer supported"]
427 #[unsafe(method(maxBiometryFailures))]
428 #[unsafe(method_family = none)]
429 pub unsafe fn maxBiometryFailures(&self) -> Option<Retained<NSNumber>>;
430
431 /// Setter for [`maxBiometryFailures`][Self::maxBiometryFailures].
432 #[deprecated = "No longer supported"]
433 #[unsafe(method(setMaxBiometryFailures:))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn setMaxBiometryFailures(&self, max_biometry_failures: Option<&NSNumber>);
436
437 /// Cancel button title.
438 ///
439 /// Allows cancel button title customization. A default title "Cancel" is used when
440 /// this property is left nil or is set to empty string.
441 #[unsafe(method(localizedCancelTitle))]
442 #[unsafe(method_family = none)]
443 pub unsafe fn localizedCancelTitle(&self) -> Option<Retained<NSString>>;
444
445 /// Setter for [`localizedCancelTitle`][Self::localizedCancelTitle].
446 #[unsafe(method(setLocalizedCancelTitle:))]
447 #[unsafe(method_family = none)]
448 pub unsafe fn setLocalizedCancelTitle(&self, localized_cancel_title: Option<&NSString>);
449
450 /// Time interval for accepting a successful Touch ID or Face ID device unlock (on the lock screen) from the past.
451 ///
452 ///
453 /// This property can be set with a time interval in seconds. If the device was successfully unlocked by
454 /// biometry within this time interval, then biometric authentication on this context will succeed
455 /// automatically and the reply block will be called without prompting user for Touch ID or Face ID.
456 ///
457 /// The default value is 0, meaning that no previous biometric unlock can be reused.
458 ///
459 /// This property is meant only for reusing biometric matches from the device lock screen.
460 /// It does not allow reusing previous biometric matches in application or between applications.
461 ///
462 /// The maximum supported interval is 5 minutes and setting the value beyond 5 minutes does not increase
463 /// the accepted interval.
464 ///
465 ///
466 /// See: LATouchIDAuthenticationMaximumAllowableReuseDuration
467 #[unsafe(method(touchIDAuthenticationAllowableReuseDuration))]
468 #[unsafe(method_family = none)]
469 pub unsafe fn touchIDAuthenticationAllowableReuseDuration(&self) -> NSTimeInterval;
470
471 /// Setter for [`touchIDAuthenticationAllowableReuseDuration`][Self::touchIDAuthenticationAllowableReuseDuration].
472 #[unsafe(method(setTouchIDAuthenticationAllowableReuseDuration:))]
473 #[unsafe(method_family = none)]
474 pub unsafe fn setTouchIDAuthenticationAllowableReuseDuration(
475 &self,
476 touch_id_authentication_allowable_reuse_duration: NSTimeInterval,
477 );
478
479 /// Allows setting the default localized authentication reason on context.
480 ///
481 ///
482 /// A localized string from this property is displayed in the authentication UI if the caller didn't specify
483 /// its own authentication reason (e.g. a keychain operation with kSecUseAuthenticationContext). This property
484 /// is ignored if the authentication reason was provided by caller.
485 #[unsafe(method(localizedReason))]
486 #[unsafe(method_family = none)]
487 pub unsafe fn localizedReason(&self) -> Retained<NSString>;
488
489 /// Setter for [`localizedReason`][Self::localizedReason].
490 #[unsafe(method(setLocalizedReason:))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn setLocalizedReason(&self, localized_reason: &NSString);
493
494 /// Allows running authentication in non-interactive mode.
495 ///
496 ///
497 /// If the context is used in a keychain query by the means of kSecUseAuthenticationContext,
498 /// then setting this property to YES has the same effect as passing kSecUseNoAuthenticationUI
499 /// in the query, i.e. the keychain call will eventually fail with errSecInteractionNotAllowed
500 /// instead of displaying the authentication UI.
501 ///
502 /// If this property is used with a LocalAuthentication evaluation, it will eventually fail with
503 /// LAErrorNotInteractive instead of displaying the authentication UI.
504 #[unsafe(method(interactionNotAllowed))]
505 #[unsafe(method_family = none)]
506 pub unsafe fn interactionNotAllowed(&self) -> bool;
507
508 /// Setter for [`interactionNotAllowed`][Self::interactionNotAllowed].
509 #[unsafe(method(setInteractionNotAllowed:))]
510 #[unsafe(method_family = none)]
511 pub unsafe fn setInteractionNotAllowed(&self, interaction_not_allowed: bool);
512
513 #[cfg(feature = "LABiometryType")]
514 /// Indicates the type of the biometry supported by the device.
515 #[unsafe(method(biometryType))]
516 #[unsafe(method_family = none)]
517 pub unsafe fn biometryType(&self) -> LABiometryType;
518
519 /// Contains policy domain state.
520 ///
521 ///
522 /// This property is set only when evaluatePolicy is called and succesful Touch ID or Face ID authentication
523 /// was performed, or when canEvaluatePolicy succeeds for a biometric policy.
524 /// It stays nil for all other cases.
525 /// If biometric database was modified (fingers or faces were removed or added), evaluatedPolicyDomainState
526 /// data will change. Nature of such database changes cannot be determined
527 /// but comparing data of evaluatedPolicyDomainState after different evaluatePolicy
528 /// will reveal the fact database was changed between calls.
529 ///
530 ///
531 /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
532 /// the state of biometry has not changed.
533 #[deprecated]
534 #[unsafe(method(evaluatedPolicyDomainState))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn evaluatedPolicyDomainState(&self) -> Option<Retained<NSData>>;
537
538 #[cfg(feature = "LADomainState")]
539 /// Contains authentication domain state.
540 #[unsafe(method(domainState))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn domainState(&self) -> Retained<LADomainState>;
543 );
544}
545
546/// Methods declared on superclass `NSObject`.
547impl LAContext {
548 extern_methods!(
549 #[unsafe(method(init))]
550 #[unsafe(method_family = init)]
551 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
552
553 #[unsafe(method(new))]
554 #[unsafe(method_family = new)]
555 pub unsafe fn new() -> Retained<Self>;
556 );
557}