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.