passkeytest

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package passkeytest is a virtual WebAuthn authenticator for tests (PHASE1 step 17): it answers the options of navigator.credentials.create() and .get() the way a browser with a platform authenticator does – ECDSA P-256, attestation "none", user verification done. Tests only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Origin string
	// UserVerified is the UV flag it reports (default true via New).
	UserVerified bool
	// contains filtered or unexported fields
}

Authenticator holds the passkeys it created.

func New

func New(origin string) *Authenticator

New returns an authenticator in a browser at origin.

func (*Authenticator) Create

func (a *Authenticator) Create(options []byte) ([]byte, error)

Create answers PublicKeyCredentialCreationOptions ({"publicKey": …}).

func (*Authenticator) Get

func (a *Authenticator) Get(options []byte) ([]byte, error)

Get answers PublicKeyCredentialRequestOptions with the first allowed credential it holds.

func (*Authenticator) SetCounter

func (a *Authenticator) SetCounter(n uint32)

SetCounter sets the signature counter of every credential (clone tests).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL