Struct webauthn_rs::prelude::SecurityKey
source · [−]pub struct SecurityKey { /* private fields */ }Expand description
A Security Key for a user.
These can be safely serialised and deserialised from a database for use.
Implementations
sourceimpl SecurityKey
impl SecurityKey
sourcepub fn cred_id(&self) -> &CredentialID
pub fn cred_id(&self) -> &CredentialID
Retrieve a reference to this Security 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 manufacterer 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 credentials 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.
Trait Implementations
sourceimpl Clone for SecurityKey
impl Clone for SecurityKey
sourcefn clone(&self) -> SecurityKey
fn clone(&self) -> SecurityKey
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more