Help us shape the future of Go! Take the 2026 Go Developer Survey

passkeytest

package
v0.40.22 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package passkeytest is a software authenticator for tests: enough of one to make attestations ("none") and assertions that the WebAuthn library accepts, with the flags, origin and counter under the test's control. Not for production use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SoftAuth

type SoftAuth struct {
	// contains filtered or unexported fields
}

SoftAuth is a software authenticator: enough of one to make attestations ("none") and assertions that the library accepts, with the flags, origin and counter under the test's control.

func New

func New(t *testing.T) *SoftAuth

New makes an authenticator with a fresh key and credential id.

func (*SoftAuth) Create

func (a *SoftAuth) Create(opts *protocol.CredentialCreation, rpID, origin string, uv bool) []byte

Create answers a registration: rpID and origin as the (possibly wrong) caller claims, uv whether it sets the UV flag.

func (*SoftAuth) CredentialID

func (a *SoftAuth) CredentialID() []byte

CredentialID is the authenticator's credential id; SetCredentialID replaces it (to forge a signature over another id).

func (*SoftAuth) SetCredentialID

func (a *SoftAuth) SetCredentialID(id []byte)

SetCredentialID sets the credential id.

func (*SoftAuth) Sign

func (a *SoftAuth) Sign(opts *protocol.CredentialAssertion, rpID, origin string, uv bool, signCount uint32, userHandle []byte) []byte

Sign answers a sign-in.

func (*SoftAuth) UserHandle

func (a *SoftAuth) UserHandle() []byte

UserHandle is the handle the last registration carried (what a sign-in must send back).

Jump to

Keyboard shortcuts

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