objc2_crypto_token_kit/generated/TKSmartCardTokenRegistrationManager.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// Provides a centralized management system for registering and unregistering smartcards
11 /// using their token IDs.
12 ///
13 ///
14 /// `Registered smartcard` keeps its itself accessible via Keychain and system will automatically
15 /// invoke an NFC slot when a cryptographic operation is required and asks to provide the registered card.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/cryptotokenkit/tksmartcardtokenregistrationmanager?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct TKSmartCardTokenRegistrationManager;
21);
22
23unsafe impl Send for TKSmartCardTokenRegistrationManager {}
24
25unsafe impl Sync for TKSmartCardTokenRegistrationManager {}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for TKSmartCardTokenRegistrationManager {}
29);
30
31impl TKSmartCardTokenRegistrationManager {
32 extern_methods!(
33 /// Default instance of registration manager
34 #[unsafe(method(defaultManager))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn defaultManager() -> Retained<TKSmartCardTokenRegistrationManager>;
37
38 /// Returns the tokenIDs of all currently registered smart card tokens
39 #[unsafe(method(registeredSmartCardTokens))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn registeredSmartCardTokens(&self) -> Retained<NSArray<NSString>>;
42
43 #[unsafe(method(init))]
44 #[unsafe(method_family = init)]
45 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
46
47 /// Registers a smartcard with a specific token ID.
48 ///
49 /// Parameter `tokenID`: ID of the smartcard
50 ///
51 /// Parameter `promptMessage`: Message that will be shown in the presented system UI when an operation with this smartcard is requested.
52 ///
53 /// Parameter `error`: On failure, this parameter is set to error describing the failure. On success, it is set to 'nil'.
54 ///
55 /// In case the same tokenID is already registered, the registration data are overwritten.
56 /// In case the smartcard with provided tokenID isn't found in the system, failure is returned.
57 #[unsafe(method(registerSmartCardWithTokenID:promptMessage:error:_))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn registerSmartCardWithTokenID_promptMessage_error(
60 &self,
61 token_id: &NSString,
62 prompt_message: &NSString,
63 ) -> Result<(), Retained<NSError>>;
64
65 /// Unregisters a smartcard for the provided token ID.
66 ///
67 /// Parameter `tokenID`: ID of the smartcard
68 ///
69 /// Parameter `error`: On failure, this parameter is set to error describing the failure. On success, it is set to 'nil'.
70 ///
71 /// In case the tokenID is not found, failure is returned.
72 #[unsafe(method(unregisterSmartCardWithTokenID:error:_))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn unregisterSmartCardWithTokenID_error(
75 &self,
76 token_id: &NSString,
77 ) -> Result<(), Retained<NSError>>;
78 );
79}
80
81/// Methods declared on superclass `NSObject`.
82impl TKSmartCardTokenRegistrationManager {
83 extern_methods!(
84 #[unsafe(method(new))]
85 #[unsafe(method_family = new)]
86 pub unsafe fn new() -> Retained<Self>;
87 );
88}