Skip to content

WebAuthnIdentity

Defined in: packages/identity/src/identity/webauthn.ts:137

A SignIdentity that uses navigator.credentials. See https://webauthn.guide/ for more information about WebAuthentication.

new WebAuthnIdentity(rawId, cose, authenticatorAttachment): WebAuthnIdentity

Defined in: packages/identity/src/identity/webauthn.ts:184

Uint8Array

Uint8Array

undefined | AuthenticatorAttachment

WebAuthnIdentity

SignIdentity.constructor

protected _principal: undefined | Principal

Defined in: packages/agent/lib/esm/auth.d.ts:52

SignIdentity._principal


protected _publicKey: CosePublicKey

Defined in: packages/identity/src/identity/webauthn.ts:182


protected authenticatorAttachment: undefined | AuthenticatorAttachment

Defined in: packages/identity/src/identity/webauthn.ts:187


readonly rawId: Uint8Array

Defined in: packages/identity/src/identity/webauthn.ts:185

getAuthenticatorAttachment(): undefined | AuthenticatorAttachment

Defined in: packages/identity/src/identity/webauthn.ts:205

WebAuthn level 3 spec introduces a new attribute on successful WebAuthn interactions, see https://w3c.github.io/webauthn/#dom-publickeycredential-authenticatorattachment. This attribute is already implemented for Chrome, Safari and Edge.

Given the attribute is only available after a successful interaction, the information is provided opportunistically and might also be undefined.

undefined | AuthenticatorAttachment


getPrincipal(): Principal

Defined in: packages/agent/lib/esm/auth.d.ts:65

Get the principal represented by this identity. Normally should be a Principal.selfAuthenticating().

Principal

SignIdentity.getPrincipal


getPublicKey(): PublicKey

Defined in: packages/identity/src/identity/webauthn.ts:193

Returns the public key that would match this identity’s signature.

PublicKey

SignIdentity.getPublicKey


sign(blob): Promise<Signature>

Defined in: packages/identity/src/identity/webauthn.ts:209

Signs a blob of data, with this identity’s private key.

Uint8Array

Promise<Signature>

SignIdentity.sign


toJSON(): JsonnableWebAuthnIdentity

Defined in: packages/identity/src/identity/webauthn.ts:249

Allow for JSON serialization of all information needed to reuse this identity.

JsonnableWebAuthnIdentity


transformRequest(request): Promise<unknown>

Defined in: packages/agent/lib/esm/auth.d.ts:72

Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.

HttpAgentRequest

internet computer request to transform

Promise<unknown>

SignIdentity.transformRequest


static create(credentialCreationOptions?): Promise<WebAuthnIdentity>

Defined in: packages/identity/src/identity/webauthn.ts:156

Create an identity.

CredentialCreationOptions

an optional CredentialCreationOptions Challenge

Promise<WebAuthnIdentity>


static fromJSON(json): WebAuthnIdentity

Defined in: packages/identity/src/identity/webauthn.ts:142

Create an identity from a JSON serialization.

string

json to parse

WebAuthnIdentity