Struct Ctap21Authenticator

Source
pub struct Ctap21Authenticator<'a, T: Token, U: UiCallback> { /* private fields */ }
Available on crate feature ctap2 only.
Expand description

CTAP 2.1 protocol implementation.

This contains only CTAP 2.1-specific functionality. All CTAP 2.0 functionality is avaliable via a Deref to Ctap20Authenticator.

Implementations§

Source§

impl<'a, T: Token, U: UiCallback> Ctap21Authenticator<'a, T, U>

Source

pub fn supports_config(&self) -> bool

Returns true if the authenticator supports configuration commands.

§See also
Source

pub async fn toggle_always_uv(&mut self) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Toggles the state of the Always Require User Verification feature.

This is only available on authenticators which support configuration.

Source

pub async fn set_min_pin_length( &mut self, new_min_pin_length: Option<u32>, min_pin_length_rpids: Vec<String>, force_change_pin: Option<bool>, ) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Sets a minimum PIN length policy.

This is only available on authenticators which support configuration.

Source

pub fn supports_enterprise_attestation(&self) -> bool

Returns true if the authenticator supports enterprise attestation.

§See also
Source

pub async fn enable_enterprise_attestation( &mut self, ) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Enables the Enterprise Attestation feature.

This is only available on authenticators which support configuration and enterprise attestation.

Source

pub fn supports_ctap21_credential_management(&self) -> bool

Source

pub async fn update_credential_user( &mut self, credential_id: PublicKeyCredentialDescriptorCM, user: UserCM, ) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Updates user information for a discoverable credential.

This is only available on authenticators which support CTAP 2.1 credential management, otherwise it returns WebauthnCError::NotSupported.

§Note

This function does not provide a “permissions RP ID” with the request, as it only works correctly with authenticators supporting the pinUvAuthToken feature.

§See also

Methods from Deref<Target = Ctap20Authenticator<'a, T, U>>§

Source

pub fn get_info(&self) -> &GetInfoResponse

Gets cached information about the authenticator.

This does not transmit to the token.

Source

pub async fn factory_reset(&mut self) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Perform a factory reset of the token, deleting all data.

Source

pub fn validate_pin(&self, pin: &str) -> Result<String, WebauthnCError>

Available on crate feature ctap2-management only.

Checks whether a provided PIN follows the rules defined by the authenticator. This does not share the PIN with the authenticator.

Source

pub async fn set_new_pin(&mut self, pin: &str) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Sets a PIN on a device which does not already have one.

To change a PIN, use change_pin().

Source

pub async fn change_pin( &mut self, old_pin: &str, new_pin: &str, ) -> Result<(), WebauthnCError>

Available on crate feature ctap2-management only.

Changes a PIN on a device.

To set a PIN for the first time, use set_new_pin().

Source

pub async fn selection(&mut self) -> Result<(), WebauthnCError>

Prompt for user presence on an authenticator.

On CTAP 2.1 authenticators, this sends a SelectionRequest.

On CTAP 2.0 and 2.1-PRE authenticators (where there is no SelectionRequest), this performs a MakeCredentialRequest with invalid PIN/UV auth parameters, using the process described in CTAP 2.1 § 6.1.2 authenticatorMakeCredential Algorithm step 1.

While this shouldn’t result in an authenticator lock-out (according to the spec), it has been observed that some authenticators will decrement their pinAttempts counter.

§References

Trait Implementations§

Source§

impl<'a, T: Debug + Token, U: Debug + UiCallback> Debug for Ctap21Authenticator<'a, T, U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: Token, U: UiCallback> Deref for Ctap21Authenticator<'a, T, U>

For backwards compatibility, pretend to be a CTAP 2.0 authenticator.

Source§

type Target = Ctap20Authenticator<'a, T, U>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Token, U: UiCallback> DerefMut for Ctap21Authenticator<'_, T, U>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T, U> Freeze for Ctap21Authenticator<'a, T, U>
where T: Freeze,

§

impl<'a, T, U> RefUnwindSafe for Ctap21Authenticator<'a, T, U>

§

impl<'a, T, U> Send for Ctap21Authenticator<'a, T, U>

§

impl<'a, T, U> Sync for Ctap21Authenticator<'a, T, U>

§

impl<'a, T, U> Unpin for Ctap21Authenticator<'a, T, U>
where T: Unpin,

§

impl<'a, T, U> UnwindSafe for Ctap21Authenticator<'a, T, U>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<'a, K, T, U, R> BiometricAuthenticator for T
where K: Token, T: BiometricAuthenticatorInfo<U, RequestType = R> + Deref<Target = Ctap20Authenticator<'a, K, U>, Target = Ctap20Authenticator<'a, K, U>> + DerefMut, U: UiCallback + 'a, R: BioEnrollmentRequestTrait,

Source§

fn check_fingerprint_support<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Checks that the device supports fingerprints. Read more
Source§

fn check_friendly_name<'life0, 'async_trait>( &'life0 mut self, friendly_name: String, ) -> Pin<Box<dyn Future<Output = Result<String, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Checks that a given friendly_name complies with authenticator limits, and returns the value in Unicode Normal Form C. Read more
Source§

fn get_fingerprint_sensor_info<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<BioEnrollmentResponse, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Gets information about the token’s fingerprint sensor. Read more
Source§

fn enroll_fingerprint<'life0, 'async_trait>( &'life0 mut self, timeout: Duration, friendly_name: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Enrolls a fingerprint with the token. Read more
Source§

fn list_fingerprints<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<TemplateInfo>, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Lists all enrolled fingerprints in the device. Read more
Source§

fn rename_fingerprint<'life0, 'async_trait>( &'life0 mut self, id: Vec<u8>, friendly_name: String, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Renames an enrolled fingerprint.
Source§

fn remove_fingerprint<'life0, 'async_trait>( &'life0 mut self, id: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Removes an enrolled fingerprint.
Source§

fn remove_fingerprints<'life0, 'async_trait>( &'life0 mut self, ids: Vec<Vec<u8>>, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Removes multiple enrolled fingerprints. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'a, K, T, U, R> CredentialManagementAuthenticator for T
where K: Token, T: CredentialManagementAuthenticatorInfo<U, RequestType = R> + Deref<Target = Ctap20Authenticator<'a, K, U>, Target = Ctap20Authenticator<'a, K, U>> + DerefMut, U: UiCallback + 'a, R: CredentialManagementRequestTrait,

Source§

fn check_credential_management_support(&self) -> Result<(), WebauthnCError>

Available on crate feature ctap2 only.
Checks that the device supports credential management. Read more
Source§

fn get_credentials_metadata<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<CredentialStorageMetadata, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Gets metadata about the authenticator’s discoverable credential storage. Read more
Source§

fn enumerate_rps<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<RelyingPartyCM>, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Enumerates a list of all relying parties with discoverable credentials stored on this authenticator. Read more
Source§

fn enumerate_credentials_by_hash<'life0, 'async_trait>( &'life0 mut self, rp_id_hash: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<DiscoverableCredential>, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Enumerates all discoverable credentials on the authenticator for a relying party, by the SHA-256 hash of the relying party ID. Read more
Source§

fn enumerate_credentials_by_rpid<'life0, 'life1, 'async_trait>( &'life0 mut self, rp_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<DiscoverableCredential>, WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Enumerates all discoverable credentials on the authenticator for a relying party, by the relying party ID. Read more
Source§

fn delete_credential<'life0, 'async_trait>( &'life0 mut self, credential_id: PublicKeyCredentialDescriptorCM, ) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate feature ctap2 only.
Deletes a discoverable credential from the authenticator. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,