Back to Content

AuthenticatorAttestationResponse: getPublicKeyAlgorithm() method

files/en-us/web/api/authenticatorattestationresponse/getpublickeyalgorithm/index.md

latest1.1 KB
Original Source

{{APIRef("Web Authentication API")}}{{securecontext_header}}

The getPublicKeyAlgorithm() method of the {{domxref("AuthenticatorAttestationResponse")}} interface returns a number that is equal to a COSE Algorithm Identifier, representing the cryptographic algorithm used for the new credential.

This is a convenience function created to allow easy access to the algorithm type. This information will need to be stored in order to verify future authentication operations (i.e., using {{domxref("CredentialsContainer.get()","navigator.credentials.get()")}}).

Syntax

js-nolint
getPublicKeyAlgorithm()

Parameters

None.

Return value

A number that is equal to a COSE Algorithm Identifier, representing the cryptographic algorithm used for the new credential.

Examples

See Creating a public key credential for a detailed example.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}