Documentation
¶
Overview ¶
Package cose reads a WebAuthn credential public key, a COSE_Key (RFC 9052 §7), for the algorithms access offers, and verifies an assertion or self attestation signature under it. Each algorithm has one exact label set (WebAuthn §6.5.1: alg is required and no other optional parameter is allowed), so a key carrying a private member or any extra label is refused.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupported = errors.New("cose: algorithm or curve not offered") ErrMalformed = errors.New("cose: malformed credential public key") ErrSignature = errors.New("cose: signature does not verify") )
The refusals, matched with errors.Is.
Functions ¶
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a parsed credential public key; the zero Key verifies nothing.
func ParseKey ¶
ParseKey reads raw as exactly one COSE_Key with no byte after it, and the key keeps no reference to raw. An algorithm or curve access does not offer is ErrUnsupported; any other refusal is ErrMalformed.