Documentation
¶
Overview ¶
Package devicetest is a virtual WebAuthn authenticator for tests: it signs device assertions as a phone's platform authenticator would, so locks and the hub can test device-signed decisions without a browser.
Index ¶
- type Authenticator
- func (a *Authenticator) Assert(challenge []byte) *ticket.DeviceAssertion
- func (a *Authenticator) AssertWith(challenge []byte, o Options) *ticket.DeviceAssertion
- func (a *Authenticator) Decide(d *ticket.Decision, signed []byte)
- func (a *Authenticator) Device() ticket.Device
- func (a *Authenticator) PublicKey() []byte
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
RPID, Origin string
Name string
Cred []byte
Key *ecdsa.PrivateKey
Seal *ecdh.PrivateKey
Counter uint32
}
Authenticator is one virtual device: a WebAuthn credential (ES256) and an X25519 sealing key.
func New ¶
func New(rpID, origin, name string) *Authenticator
New is a fresh authenticator for the relying party rpID at origin.
func (*Authenticator) Assert ¶
func (a *Authenticator) Assert(challenge []byte) *ticket.DeviceAssertion
Assert signs challenge as a user-verified assertion.
func (*Authenticator) AssertWith ¶
func (a *Authenticator) AssertWith(challenge []byte, o Options) *ticket.DeviceAssertion
AssertWith signs challenge with o.
func (*Authenticator) Decide ¶
func (a *Authenticator) Decide(d *ticket.Decision, signed []byte)
Decide makes d a decision taken on a about the signed ticket it showed: approver and facade, then the assertion over its statement. d is signed by the hub afterwards.
func (*Authenticator) Device ¶
func (a *Authenticator) Device() ticket.Device
Device is the record a lock pins for a.
func (*Authenticator) PublicKey ¶
func (a *Authenticator) PublicKey() []byte
PublicKey is the credential's uncompressed P-256 point.