pub struct AttestedPasskey { /* private fields */ }
attestation
only.Expand description
An attested passkey for a user. This is a specialisation of Passkey as you can limit the make and models of authenticators that a user may register. Additionally these keys will always enforce user verification.
These can be safely serialised and deserialised from a database for use.
Implementations§
Source§impl AttestedPasskey
impl AttestedPasskey
Sourcepub fn cred_id(&self) -> &CredentialID
pub fn cred_id(&self) -> &CredentialID
Retrieve a reference to this AttestedPasskey Key’s credential ID.
Sourcepub fn cred_algorithm(&self) -> &COSEAlgorithm
pub fn cred_algorithm(&self) -> &COSEAlgorithm
Retrieve the type of cryptographic algorithm used by this key
Sourcepub fn attestation(&self) -> &ParsedAttestation
pub fn attestation(&self) -> &ParsedAttestation
Retrieve a reference to the attestation used during this Credential
’s
registration. This can tell you information about the manufacturer and
what type of credential it is.
Sourcepub fn update_credential(&mut self, res: &AuthenticationResult) -> Option<bool>
pub fn update_credential(&mut self, res: &AuthenticationResult) -> Option<bool>
Post authentication, update this credential’s properties.
To determine if this is required, you can inspect the result of
authentication_result.needs_update()
. Generally this will always
be true as this class of key will maintain an activation counter which
allows (limited) protection against device cloning.
If the credential_id does not match, None is returned. If the cred id matches and the credential is updated, Some(true) is returned. If the cred id matches, but the credential is not changed, Some(false) is returned.
Sourcepub fn verify_attestation<'a>(
&self,
ca_list: &'a AttestationCaList,
) -> Result<&'a AttestationCa, WebauthnError>
pub fn verify_attestation<'a>( &self, ca_list: &'a AttestationCaList, ) -> Result<&'a AttestationCa, WebauthnError>
Re-verify this Credential’s attestation chain. This re-applies the same process for certificate authority verification that occured at registration. This can be useful if you want to re-assert your credentials match an updated or changed ca_list from the time that registration occured. This can also be useful to re-determine certain properties of your device that may exist.
Trait Implementations§
Source§impl Borrow<HumanBinaryData> for AttestedPasskey
impl Borrow<HumanBinaryData> for AttestedPasskey
Source§fn borrow(&self) -> &CredentialID
fn borrow(&self) -> &CredentialID
Source§impl Clone for AttestedPasskey
impl Clone for AttestedPasskey
Source§fn clone(&self) -> AttestedPasskey
fn clone(&self) -> AttestedPasskey
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AttestedPasskey
impl Debug for AttestedPasskey
Source§impl<'de> Deserialize<'de> for AttestedPasskey
impl<'de> Deserialize<'de> for AttestedPasskey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&AttestedPasskey> for DiscoverableKey
Available on crate feature conditional-ui
only.
impl From<&AttestedPasskey> for DiscoverableKey
conditional-ui
only.Source§fn from(k: &AttestedPasskey) -> Self
fn from(k: &AttestedPasskey) -> Self
Source§impl From<&AttestedPasskey> for Passkey
impl From<&AttestedPasskey> for Passkey
Source§fn from(k: &AttestedPasskey) -> Self
fn from(k: &AttestedPasskey) -> Self
Source§impl From<AttestedPasskey> for Credential
Available on crate feature danger-credential-internals
only.
impl From<AttestedPasskey> for Credential
danger-credential-internals
only.Source§fn from(pk: AttestedPasskey) -> Self
fn from(pk: AttestedPasskey) -> Self
Source§impl From<AttestedPasskey> for DiscoverableKey
Available on crate feature conditional-ui
only.
impl From<AttestedPasskey> for DiscoverableKey
conditional-ui
only.Source§fn from(k: AttestedPasskey) -> Self
fn from(k: AttestedPasskey) -> Self
Source§impl From<AttestedPasskey> for Passkey
impl From<AttestedPasskey> for Passkey
Source§fn from(k: AttestedPasskey) -> Self
fn from(k: AttestedPasskey) -> Self
Source§impl From<CredentialV5> for AttestedPasskey
Available on crate feature danger-credential-internals
only.
impl From<CredentialV5> for AttestedPasskey
danger-credential-internals
only.Source§fn from(cred: Credential) -> Self
fn from(cred: Credential) -> Self
Convert a generic webauthn credential into an AttestedPasskey