pub struct Credential<'a> { /* private fields */ }Implementations§
Source§impl<'a> Credential<'a>
impl<'a> Credential<'a>
Sourcepub fn builder(
credential_id: impl Into<Cow<'a, str>>,
is_resident_credential: bool,
private_key: impl Into<Cow<'a, str>>,
sign_count: u64,
) -> CredentialBuilder<'a>
pub fn builder( credential_id: impl Into<Cow<'a, str>>, is_resident_credential: bool, private_key: impl Into<Cow<'a, str>>, sign_count: u64, ) -> CredentialBuilder<'a>
Creates a builder for this type with the required parameters:
credential_id:is_resident_credential:private_key: The ECDSA P-256 private key in PKCS#8 format. (Encoded as a base64 string when passed over JSON)sign_count: Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
pub fn credential_id(&self) -> &str
pub fn is_resident_credential(&self) -> bool
Sourcepub fn rp_id(&self) -> Option<&str>
pub fn rp_id(&self) -> Option<&str>
Relying Party ID the credential is scoped to. Must be set when adding a credential.
Sourcepub fn private_key(&self) -> &str
pub fn private_key(&self) -> &str
The ECDSA P-256 private key in PKCS#8 format. (Encoded as a base64 string when passed over JSON)
Sourcepub fn user_handle(&self) -> Option<&str>
pub fn user_handle(&self) -> Option<&str>
An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user. (Encoded as a base64 string when passed over JSON)
Sourcepub fn sign_count(&self) -> u64
pub fn sign_count(&self) -> u64
Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
Sourcepub fn large_blob(&self) -> Option<&str>
pub fn large_blob(&self) -> Option<&str>
The large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension (Encoded as a base64 string when passed over JSON)
Sourcepub fn backup_eligibility(&self) -> Option<bool>
pub fn backup_eligibility(&self) -> Option<bool>
Assertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator’s defaultBackupEligibility value.
Sourcepub fn backup_state(&self) -> Option<bool>
pub fn backup_state(&self) -> Option<bool>
Assertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator’s defaultBackupState value.
Sourcepub fn user_name(&self) -> Option<&str>
pub fn user_name(&self) -> Option<&str>
The credential’s user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name
Sourcepub fn user_display_name(&self) -> Option<&str>
pub fn user_display_name(&self) -> Option<&str>
The credential’s user.displayName property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname
Trait Implementations§
Source§impl<'a> Clone for Credential<'a>
impl<'a> Clone for Credential<'a>
Source§fn clone(&self) -> Credential<'a>
fn clone(&self) -> Credential<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more