PublicKeyCredential

The PublicKeyCredential interface provides information about a public key / private key pair, which is a credential for logging in to a service using an un-phishable and data-breach resistant asymmetric key pair instead of a password. It inherits from Credential, and is part of the Web Authentication API extension to the Credential Management API. Available only in secure contexts.

MDN Reference

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The authenticatorAttachment read-only property of the PublicKeyCredential interface is a string that indicates the general category of authenticator used during the associated navigator.credentials.create() or navigator.credentials.get() call.

Link copied to clipboard
val id: String

The id read-only property of the Credential interface returns a string containing the credential's identifier. This might be a GUID, username, or email address, or some other value, depending on the type of credential.

Link copied to clipboard

The rawId read-only property of the PublicKeyCredential interface is an ArrayBuffer object containing the identifier of the credentials.

Link copied to clipboard

The response read-only property of the PublicKeyCredential interface is an AuthenticatorResponse object which is sent from the authenticator to the user agent for the creation/fetching of credentials. The information contained in this response will be used by the relying party's server to verify the demand is legitimate.

Link copied to clipboard

The type read-only property of the Credential interface returns a string containing the credential's type. Valid values are password, federated, public-key, identity and otp.

Functions

Link copied to clipboard

The getClientExtensionResults() method of the PublicKeyCredential interface returns an object mapping the identifiers of extensions requested during credential creation or authentication, and their results after processing by the user agent.

Link copied to clipboard

The toJSON() method of the PublicKeyCredential interface returns a JSON type representation of a PublicKeyCredential.