Documentation
¶
Overview ¶
Package jwk parses a JWK Set (RFC 7517) into the public keys oidc verifies ID tokens with: RSA, EC on P-256, P-384 and P-521, and OKP Ed25519 (RFC 7518 §6, RFC 8037 §2).
Index ¶
Constants ¶
const MaxKeys = 100
MaxKeys is the most keys a JWK Set may hold before Parse refuses it.
Variables ¶
var ErrSet = errors.New("jwk: JWK Set refused")
ErrSet is the error Parse wraps when it refuses a whole JWK Set.
Functions ¶
This section is empty.
Types ¶
type Alg ¶
type Alg uint8
Alg is one row of the accepted-algorithm table; the zero Alg names no row.
The rows, one per JWS alg value (RFC 7518 §3.1), except EdDSA, which the fully specified name Ed25519 also names (RFC 9864 §2.2).
func (Alg) SignatureSize ¶
SignatureSize is the exact signature length an ES row splits into R ‖ S (RFC 7518 §3.4); zero for the rows whose verify call checks the size itself.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is one usable verification key.
func (Key) Fits ¶
Fits reports whether the key may verify under row a: its type and curve are a's, and its own alg, when present, names a (RFC 8725 §3.1).
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is the usable keys of a JWK Set, in the set's order.
func Parse ¶
Parse classifies every JWK of a JWK Set. It refuses the whole set, with ErrSet, when the document is not one, holds more than MaxKeys keys or an entry that is not an object, or publishes a private RSA, EC or OKP key; it skips any other key it cannot use (RFC 7517 §5), so the Set may be empty.