objc2-authentication-services 0.3.2

Bindings to the AuthenticationServices framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationpublickeycredentialregistrationrequest?language=objc)
    pub unsafe trait ASAuthorizationPublicKeyCredentialRegistrationRequest:
        NSObjectProtocol + NSSecureCoding + NSCopying
    {
        /// The Relying Party identifier used to scope this request.
        #[unsafe(method(relyingPartyIdentifier))]
        #[unsafe(method_family = none)]
        unsafe fn relyingPartyIdentifier(&self) -> Retained<NSString>;

        /// An arbitrary byte sequence which will be stored alongside the credential and will be returned with the credential when authenticating with it in the future. May be used by a relying party to identify the user account this credential is associated with.
        #[unsafe(method(userID))]
        #[unsafe(method_family = none)]
        unsafe fn userID(&self) -> Retained<NSData>;

        /// Setter for [`userID`][Self::userID].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setUserID:))]
        #[unsafe(method_family = none)]
        unsafe fn setUserID(&self, user_id: &NSData);

        /// A human readable name to associate with a credential, which a user should be able to use to identify the credential.
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        unsafe fn name(&self) -> Retained<NSString>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        unsafe fn setName(&self, name: &NSString);

        /// A high level human readable name to associate with a credential, which should only be used for display.
        #[unsafe(method(displayName))]
        #[unsafe(method_family = none)]
        unsafe fn displayName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`displayName`][Self::displayName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDisplayName:))]
        #[unsafe(method_family = none)]
        unsafe fn setDisplayName(&self, display_name: Option<&NSString>);

        /// The challenge which can be used to verify the authenticator's attestation, if attestation is requested.
        #[unsafe(method(challenge))]
        #[unsafe(method_family = none)]
        unsafe fn challenge(&self) -> Retained<NSData>;

        /// Setter for [`challenge`][Self::challenge].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setChallenge:))]
        #[unsafe(method_family = none)]
        unsafe fn setChallenge(&self, challenge: &NSData);

        #[cfg(feature = "ASAuthorizationPublicKeyCredentialConstants")]
        /// A preference for whether the authenticator should attempt to verify that it is being used by its owner, such as through a PIN or biometrics.
        #[unsafe(method(userVerificationPreference))]
        #[unsafe(method_family = none)]
        unsafe fn userVerificationPreference(
            &self,
        ) -> Retained<ASAuthorizationPublicKeyCredentialUserVerificationPreference>;

        #[cfg(feature = "ASAuthorizationPublicKeyCredentialConstants")]
        /// Setter for [`userVerificationPreference`][Self::userVerificationPreference].
        #[unsafe(method(setUserVerificationPreference:))]
        #[unsafe(method_family = none)]
        unsafe fn setUserVerificationPreference(
            &self,
            user_verification_preference: &ASAuthorizationPublicKeyCredentialUserVerificationPreference,
        );

        #[cfg(feature = "ASAuthorizationPublicKeyCredentialConstants")]
        /// A preference for the type of attestation that the authenticator should attempt to perform.
        #[unsafe(method(attestationPreference))]
        #[unsafe(method_family = none)]
        unsafe fn attestationPreference(
            &self,
        ) -> Retained<ASAuthorizationPublicKeyCredentialAttestationKind>;

        #[cfg(feature = "ASAuthorizationPublicKeyCredentialConstants")]
        /// Setter for [`attestationPreference`][Self::attestationPreference].
        #[unsafe(method(setAttestationPreference:))]
        #[unsafe(method_family = none)]
        unsafe fn setAttestationPreference(
            &self,
            attestation_preference: &ASAuthorizationPublicKeyCredentialAttestationKind,
        );
    }
);