PublicKeyCredential Class
A public key credential of Web Authentication (https://w3c.github.io/webauthn/#iface-pkcredential): the result of a registration (navigator.credentials.create()) or of an authentication (navigator.credentials.get()).
public sealed class PublicKeyCredential : Credential- Inheritance
CredentialPublicKeyCredential
Properties
| Name | Description |
|---|---|
| AuthenticatorAttachment | Gets the attachment modality of the authenticator (platform or cross-platform), or null. |
| Id | Gets the base64url encoding of the credential ID. |
| RawId | Gets the credential ID (https://w3c.github.io/webauthn/#dom-publickeycredential-identifier-slot). |
| RawIdBuffer | Gets the ArrayBuffer of the credential ID for the scripts: use PublicKeyCredential.RawId in .NET code. |
| Response | Gets the response of the authenticator: an AuthenticatorAttestationResponse or an AuthenticatorAssertionResponse. |
| Type | Gets the type of the credential: public-key. |
AuthenticatorAttachment
PublicKeyCredential.csGets the attachment modality of the authenticator (platform or cross-platform), or null.
public string? AuthenticatorAttachment { get; }Property value
See also
Gets the base64url encoding of the credential ID.
public override string Id { get; }Gets the credential ID (https://w3c.github.io/webauthn/#dom-publickeycredential-identifier-slot).
public ReadOnlyMemory<byte> RawId { get; }Property value
RawIdBuffer
PublicKeyCredential.csGets the ArrayBuffer of the credential ID for the scripts: use PublicKeyCredential.RawId in .NET code.
public object RawIdBuffer { get; }Response
PublicKeyCredential.csGets the response of the authenticator: an AuthenticatorAttestationResponse or an AuthenticatorAssertionResponse.
public AuthenticatorResponse Response { get; }Property value
See also
Methods
| Name | Description |
|---|---|
| GetClientCapabilities() | Returns the capabilities of the client (https://w3c.github.io/webauthn/#sctn-getClientCapabilities), sorted by name: the values of ClientCapability and the implemented extensions (extension: followed by their identifier). |
| GetClientExtensionResults() | Returns the outputs of the client extensions (https://w3c.github.io/webauthn/#dom-publickeycredential-getclientextensionresults). |
| IsConditionalMediationAvailable() | Whether the conditional mediation of navigator.credentials.get() is available: true. |
| IsUserVerifyingPlatformAuthenticatorAvailable() | Whether a user-verifying platform authenticator is available (https://w3c.github.io/webauthn/#sctn-isUserVerifyingPlatformAuthenticatorAvailable): an authenticator of WebAuthenticationOptions.Authenticators whose transport is internal and that can perform user verification. |
| ParseCreationOptionsFromJson(PublicKeyCredentialCreationOptionsJson) | Converts the JSON type of the options of a registration (https://w3c.github.io/webauthn/#sctn-parseCreationOptionsFromJSON): the base64url-encoded strings are decoded. Throws an EncodingError DomException when a value is not a valid base64url encoding. |
| ParseRequestOptionsFromJson(PublicKeyCredentialRequestOptionsJson) | Converts the JSON type of the options of an authentication (https://w3c.github.io/webauthn/#sctn-parseRequestOptionsFromJSON): the base64url-encoded strings are decoded. Throws an EncodingError DomException when a value is not a valid base64url encoding. |
| SignalAllAcceptedCredentials(AllAcceptedCredentialsOptions) | Signals the complete list of the credentials of a user (https://w3c.github.io/webauthn/#sctn-signalAllAcceptedCredentials): the virtual authenticators remove the discoverable credentials of the user that are not in the list. The task fails with a TypeErrorException when a value is not a valid base64url encoding, and a SecurityError DomException when the RP ID is not valid for the origin of the caller. |
| SignalCurrentUserDetails(CurrentUserDetailsOptions) | Signals the current name and display name of a user (https://w3c.github.io/webauthn/#sctn-signalCurrentUserDetails): the virtual authenticators update the discoverable credential of the user. The task fails with a TypeErrorException when the user ID is not a valid base64url encoding, and a SecurityError DomException when the RP ID is not valid for the origin of the caller. |
| SignalUnknownCredential(UnknownCredentialOptions) | Signals that the relying party does not recognize a credential (https://w3c.github.io/webauthn/#sctn-signalUnknownCredential): the virtual authenticators remove it. The task fails with a TypeErrorException when the credential ID is not a valid base64url encoding, and a SecurityError DomException when the RP ID is not valid for the origin of the caller. |
| ToJson() | Returns the JSON type of the credential (https://w3c.github.io/webauthn/#dom-publickeycredential-tojson): a RegistrationResponseJson or an AuthenticationResponseJson, whose binary values are base64url-encoded. |
GetClientCapabilities()
PublicKeyCredential.csReturns the capabilities of the client (https://w3c.github.io/webauthn/#sctn-getClientCapabilities), sorted by name: the values of ClientCapability and the implemented extensions (extension: followed by their identifier).
public static Task<IReadOnlyList<KeyValuePair<string, bool>>> GetClientCapabilities()GetClientExtensionResults()
PublicKeyCredential.csReturns the outputs of the client extensions (https://w3c.github.io/webauthn/#dom-publickeycredential-getclientextensionresults).
public AuthenticationExtensionsClientOutputs GetClientExtensionResults()IsConditionalMediationAvailable()
PublicKeyCredential.csWhether the conditional mediation of navigator.credentials.get() is available: true.
IsUserVerifyingPlatformAuthenticatorAvailable()
PublicKeyCredential.csWhether a user-verifying platform authenticator is available (https://w3c.github.io/webauthn/#sctn-isUserVerifyingPlatformAuthenticatorAvailable): an authenticator of WebAuthenticationOptions.Authenticators whose transport is internal and that can perform user verification.
ParseCreationOptionsFromJson(PublicKeyCredentialCreationOptionsJson)
PublicKeyCredential.csConverts the JSON type of the options of a registration (https://w3c.github.io/webauthn/#sctn-parseCreationOptionsFromJSON): the base64url-encoded strings are decoded. Throws an EncodingError DomException when a value is not a valid base64url encoding.
public static PublicKeyCredentialCreationOptions ParseCreationOptionsFromJson(PublicKeyCredentialCreationOptionsJson options)ParseRequestOptionsFromJson(PublicKeyCredentialRequestOptionsJson)
PublicKeyCredential.csConverts the JSON type of the options of an authentication (https://w3c.github.io/webauthn/#sctn-parseRequestOptionsFromJSON): the base64url-encoded strings are decoded. Throws an EncodingError DomException when a value is not a valid base64url encoding.
public static PublicKeyCredentialRequestOptions ParseRequestOptionsFromJson(PublicKeyCredentialRequestOptionsJson options)SignalAllAcceptedCredentials(AllAcceptedCredentialsOptions)
PublicKeyCredential.csSignals the complete list of the credentials of a user (https://w3c.github.io/webauthn/#sctn-signalAllAcceptedCredentials): the virtual authenticators remove the discoverable credentials of the user that are not in the list. The task fails with a TypeErrorException when a value is not a valid base64url encoding, and a SecurityError DomException when the RP ID is not valid for the origin of the caller.
public static Task SignalAllAcceptedCredentials(AllAcceptedCredentialsOptions options)SignalCurrentUserDetails(CurrentUserDetailsOptions)
PublicKeyCredential.csSignals the current name and display name of a user (https://w3c.github.io/webauthn/#sctn-signalCurrentUserDetails): the virtual authenticators update the discoverable credential of the user. The task fails with a TypeErrorException when the user ID is not a valid base64url encoding, and a SecurityError DomException when the RP ID is not valid for the origin of the caller.
public static Task SignalCurrentUserDetails(CurrentUserDetailsOptions options)SignalUnknownCredential(UnknownCredentialOptions)
PublicKeyCredential.csSignals that the relying party does not recognize a credential (https://w3c.github.io/webauthn/#sctn-signalUnknownCredential): the virtual authenticators remove it. The task fails with a TypeErrorException when the credential ID is not a valid base64url encoding, and a SecurityError DomException when the RP ID is not valid for the origin of the caller.
public static Task SignalUnknownCredential(UnknownCredentialOptions options)ToJson()
PublicKeyCredential.csReturns the JSON type of the credential (https://w3c.github.io/webauthn/#dom-publickeycredential-tojson): a RegistrationResponseJson or an AuthenticationResponseJson, whose binary values are base64url-encoded.
public object ToJson()