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/asauthorizationpublickeycredentialassertionrequest?language=objc)
    pub unsafe trait ASAuthorizationPublicKeyCredentialAssertionRequest:
        NSObjectProtocol + NSSecureCoding + NSCopying
    {
        /// The challenge to use when signing the request.
        #[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);

        /// The Relying Party identifier used to scope this request.
        #[unsafe(method(relyingPartyIdentifier))]
        #[unsafe(method_family = none)]
        unsafe fn relyingPartyIdentifier(&self) -> Retained<NSString>;

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

        #[cfg(feature = "ASAuthorizationPublicKeyCredentialDescriptor")]
        /// A list of credentials to allow for this request. If this list is nonempty, only credentials matching the provided descriptors can be used to sign in.
        #[unsafe(method(allowedCredentials))]
        #[unsafe(method_family = none)]
        unsafe fn allowedCredentials(
            &self,
        ) -> Retained<NSArray<ProtocolObject<dyn ASAuthorizationPublicKeyCredentialDescriptor>>>;

        #[cfg(feature = "ASAuthorizationPublicKeyCredentialDescriptor")]
        /// Setter for [`allowedCredentials`][Self::allowedCredentials].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAllowedCredentials:))]
        #[unsafe(method_family = none)]
        unsafe fn setAllowedCredentials(
            &self,
            allowed_credentials: &NSArray<
                ProtocolObject<dyn ASAuthorizationPublicKeyCredentialDescriptor>,
            >,
        );

        #[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,
        );
    }
);