objc2_authentication_services/generated/
ASPasskeyAssertionCredential.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
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/aspasskeyassertioncredential?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct ASPasskeyAssertionCredential;
15);
16
17#[cfg(feature = "ASAuthorizationCredential")]
18extern_conformance!(
19    unsafe impl ASAuthorizationCredential for ASPasskeyAssertionCredential {}
20);
21
22extern_conformance!(
23    unsafe impl NSCoding for ASPasskeyAssertionCredential {}
24);
25
26extern_conformance!(
27    unsafe impl NSCopying for ASPasskeyAssertionCredential {}
28);
29
30unsafe impl CopyingHelper for ASPasskeyAssertionCredential {
31    type Result = Self;
32}
33
34extern_conformance!(
35    unsafe impl NSObjectProtocol for ASPasskeyAssertionCredential {}
36);
37
38extern_conformance!(
39    unsafe impl NSSecureCoding for ASPasskeyAssertionCredential {}
40);
41
42impl ASPasskeyAssertionCredential {
43    extern_methods!(
44        /// Initializes an ASPasskeyCredential object.
45        ///
46        /// Parameter `userHandle`: The identifier for the account the passkey is associated with.
47        ///
48        /// Parameter `relyingParty`: the relying party.
49        ///
50        /// Parameter `signature`: the signature for the assertion challenge.
51        #[unsafe(method(initWithUserHandle:relyingParty:signature:clientDataHash:authenticatorData:credentialID:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithUserHandle_relyingParty_signature_clientDataHash_authenticatorData_credentialID(
54            this: Allocated<Self>,
55            user_handle: &NSData,
56            relying_party: &NSString,
57            signature: &NSData,
58            client_data_hash: &NSData,
59            authenticator_data: &NSData,
60            credential_id: &NSData,
61        ) -> Retained<Self>;
62
63        #[cfg(feature = "ASPasskeyAssertionCredentialExtensionOutput")]
64        /// Initializes an ASPasskeyCredential object.
65        ///
66        /// Parameter `userHandle`: The identifier for the account the passkey is associated with.
67        ///
68        /// Parameter `relyingParty`: The relying party.
69        ///
70        /// Parameter `signature`: The signature for the assertion challenge.
71        ///
72        /// Parameter `extensionOutput`: The outputs of WebAuthn extensions processed by the credential provider.
73        #[unsafe(method(initWithUserHandle:relyingParty:signature:clientDataHash:authenticatorData:credentialID:extensionOutput:))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn initWithUserHandle_relyingParty_signature_clientDataHash_authenticatorData_credentialID_extensionOutput(
76            this: Allocated<Self>,
77            user_handle: &NSData,
78            relying_party: &NSString,
79            signature: &NSData,
80            client_data_hash: &NSData,
81            authenticator_data: &NSData,
82            credential_id: &NSData,
83            extension_output: Option<&ASPasskeyAssertionCredentialExtensionOutput>,
84        ) -> Retained<Self>;
85
86        /// Creates and initializes a new ASPasskeyCredential object.
87        ///
88        /// Parameter `userHandle`: The identifier for the account the passkey is associated with.
89        ///
90        /// Parameter `relyingParty`: the relying party.
91        ///
92        /// Parameter `signature`: the signature for the assertion challenge.
93        #[unsafe(method(credentialWithUserHandle:relyingParty:signature:clientDataHash:authenticatorData:credentialID:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn credentialWithUserHandle_relyingParty_signature_clientDataHash_authenticatorData_credentialID(
96            user_handle: &NSData,
97            relying_party: &NSString,
98            signature: &NSData,
99            client_data_hash: &NSData,
100            authenticator_data: &NSData,
101            credential_id: &NSData,
102        ) -> Retained<Self>;
103
104        /// The user handle of this passkey.
105        #[unsafe(method(userHandle))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn userHandle(&self) -> Retained<NSData>;
108
109        /// The relying party of this credential.
110        #[unsafe(method(relyingParty))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn relyingParty(&self) -> Retained<NSString>;
113
114        /// The signature of this credential.
115        #[unsafe(method(signature))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn signature(&self) -> Retained<NSData>;
118
119        /// The hash of the client data for this assertion result.
120        #[unsafe(method(clientDataHash))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn clientDataHash(&self) -> Retained<NSData>;
123
124        /// The authenticator data of the application that created this credential.
125        #[unsafe(method(authenticatorData))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn authenticatorData(&self) -> Retained<NSData>;
128
129        /// The raw credential ID for this passkey credential.
130        #[unsafe(method(credentialID))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn credentialID(&self) -> Retained<NSData>;
133
134        #[cfg(feature = "ASPasskeyAssertionCredentialExtensionOutput")]
135        /// The outputs of WebAuthn extensions processed by the credential provider.
136        #[unsafe(method(extensionOutput))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn extensionOutput(
139            &self,
140        ) -> Option<Retained<ASPasskeyAssertionCredentialExtensionOutput>>;
141
142        #[cfg(feature = "ASPasskeyAssertionCredentialExtensionOutput")]
143        /// Setter for [`extensionOutput`][Self::extensionOutput].
144        #[unsafe(method(setExtensionOutput:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setExtensionOutput(
147            &self,
148            extension_output: Option<&ASPasskeyAssertionCredentialExtensionOutput>,
149        );
150    );
151}
152
153/// Methods declared on superclass `NSObject`.
154impl ASPasskeyAssertionCredential {
155    extern_methods!(
156        #[unsafe(method(init))]
157        #[unsafe(method_family = init)]
158        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
159
160        #[unsafe(method(new))]
161        #[unsafe(method_family = new)]
162        pub unsafe fn new() -> Retained<Self>;
163    );
164}