pub struct PublicKeyCredentialDescriptor {
pub ty: PublicKeyCredentialType,
pub id: Bytes,
pub transports: Option<Vec<AuthenticatorTransport>>,
}Expand description
Identifies a specific public key credential. It is used in PublicKeyCredentialCreationOptions::exclude_credentials
to prevent creating duplicate credentials on the same authenticator, and in PublicKeyCredentialRequestOptions::allow_credentials
to determine if and how the credential can currently be reached by the client. It mirrors some
fields of the PublicKeyCredential object returned by the create() and get() operations.
It is recommended to ignore any credential whose type is PublicKeyCredentialType::Unknown
https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptor
Fields§
§ty: PublicKeyCredentialTypeThis member contains the type of the public key credential the caller is referring to. The
value SHOULD be a member of PublicKeyCredentialType but client platforms MUST ignore any
PublicKeyCredentialDescriptor with an PublicKeyCredentialType::Unknown type.
This mirrors the PublicKeyCredential::ty field.
id: BytesThis member contains the credential ID of the public key credential the caller is referring to.
This mirrors the PublicKeyCredential::raw_id field.
transports: Option<Vec<AuthenticatorTransport>>This OPTIONAL member contains a hint as to how the client might communicate with the managing
authenticator of the PublicKeyCredential the caller is referring to. The values SHOULD be
members of AuthenticatorTransport but client platforms MUST ignore unknown values.
This mirrors the AuthenticatorAttestationResponse::transports field of a
PublicKeyCredential::response structure created by a create() operation. When registering
a new credential, the Relying Party SHOULD store the value returned from
AuthenticatorAttestationResponse::transports. When creating a PublicKeyCredentialDescriptor
for that credential, the Relying Party SHOULD retrieve that stored value and set it as the
value of the transports member.
Implementations§
Source§impl PublicKeyCredentialDescriptor
impl PublicKeyCredentialDescriptor
Sourcepub fn is_known(&self) -> bool
pub fn is_known(&self) -> bool
Checks whether Self::ty is not of value PublicKeyCredentialType::Unknown. This should
be used for filtering a list of PublicKeyCredentialDescriptors that are not of a known type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKeyCredentialDescriptor
impl<'de> Deserialize<'de> for PublicKeyCredentialDescriptor
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<&Passkey> for PublicKeyCredentialDescriptor
impl From<&Passkey> for PublicKeyCredentialDescriptor
Source§impl From<Passkey> for PublicKeyCredentialDescriptor
impl From<Passkey> for PublicKeyCredentialDescriptor
Source§impl PartialEq for PublicKeyCredentialDescriptor
impl PartialEq for PublicKeyCredentialDescriptor
Source§fn eq(&self, other: &PublicKeyCredentialDescriptor) -> bool
fn eq(&self, other: &PublicKeyCredentialDescriptor) -> bool
self and other values to be equal, and is used by ==.impl Eq for PublicKeyCredentialDescriptor
impl StructuralPartialEq for PublicKeyCredentialDescriptor
Auto Trait Implementations§
impl Freeze for PublicKeyCredentialDescriptor
impl RefUnwindSafe for PublicKeyCredentialDescriptor
impl Send for PublicKeyCredentialDescriptor
impl Sync for PublicKeyCredentialDescriptor
impl Unpin for PublicKeyCredentialDescriptor
impl UnwindSafe for PublicKeyCredentialDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.