object

# `open_id_jwks`

JSON Web Key Set parsing and key selection helpers.

Availability:
`logtalk_load(open_id(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-07-08
Compilation flags:
`static, context_switching_calls`
Imports:
`public` open_id_helpers
Uses:
list
Remarks:
(none)
Inherited public predicates:
check_option/1 check_options/1 default_option/1 default_options/1 option/2 option/3 valid_option/1 valid_options/1

## Public predicates

### `select_key/3`

Selects a matching verification key from a JWK Set for a JWT header.

Compilation flags:
`static`
Template:
`select_key(JWKSet,Header,Key)`
Mode and number of proofs:
`select_key(+term,+term,-term)` - `one_or_error`
Exceptions:
`JWKSet` is not a JSON Web Key Set with a `keys` list:
`domain_error(open_id_jwks,JWKSet)`
`Header` does not contain a valid `alg` member:
`domain_error(open_id_jwt_header,Header)`
No compatible key exists for `Header`:
`existence_error(open_id_jwk,Header)`

### `header_algorithm/2`

Extracts and validates the JWT header algorithm.

Compilation flags:
`static`
Template:
`header_algorithm(Header,Algorithm)`
Mode and number of proofs:
`header_algorithm(+term,-atom)` - `one_or_error`
Exceptions:
`Header` does not contain a valid `alg` member:
`domain_error(open_id_jwt_header,Header)`

### `header_key_id/2`

Extracts the optional key identifier from a JWT header.

Compilation flags:
`static`
Template:
`header_key_id(Header,KeyId)`
Mode and number of proofs:
`header_key_id(+term,-atom)` - `zero_or_one`

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)