object

# `jwt_jwks`

JSON Web Key Set validation and key selection helpers.

Availability:
`logtalk_load(jwt(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-07-06
Compilation flags:
`static, context_switching_calls`
Imports:
`public` jwt_helpers
Uses:
jwt_jwa
jwt_jwk
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

### `validate/1`

Validates that a term is a JSON Web Key Set.

Compilation flags:
`static`
Template:
`validate(JWKSet)`
Mode and number of proofs:
`validate(+term)` - `one_or_error`
Exceptions:
`JWKSet` is not a JSON Web Key Set with a `keys` list:
`domain_error(jwt_jwks,JWKSet)`

### `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(jwt_jwks,JWKSet)`
`Header` does not contain a valid `alg` member:
`domain_error(jwt_header,Header)`
The JWT algorithm is unsupported or disallowed:
`domain_error(jwt_algorithm,Algorithm)`
No compatible key exists for `Header`:
`existence_error(jwt_jwk,Header)`

### `select_key/4`

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

Compilation flags:
`static`
Template:
`select_key(JWKSet,Header,Key,Options)`
Mode and number of proofs:
`select_key(+term,+term,-term,+list(compound))` - `one_or_error`
Exceptions:
`Options` is a variable or a partial list:
`instantiation_error`
`Options` is neither a variable nor a list:
`type_error(list,Options)`
An element `Option` of the list `Options` is neither a variable nor a compound term:
`type_error(compound,Option)`
An element `Option` of the list `Options` is a compound term but not a valid option:
`domain_error(option,Option)`
`JWKSet` is not a JSON Web Key Set with a `keys` list:
`domain_error(jwt_jwks,JWKSet)`
`Header` does not contain a valid `alg` member:
`domain_error(jwt_header,Header)`
The JWT algorithm is unsupported or disallowed:
`domain_error(jwt_algorithm,Algorithm)`
No compatible key exists for `Header`:
`existence_error(jwt_jwk,Header)`

### `select_keys/4`

Selects all matching verification keys from a JWK Set for a JWT header and options.

Compilation flags:
`static`
Template:
`select_keys(JWKSet,Header,Keys,Options)`
Mode and number of proofs:
`select_keys(+term,+term,-list(term),+list(compound))` - `one_or_error`
Exceptions:
`Options` is a variable or a partial list:
`instantiation_error`
`Options` is neither a variable nor a list:
`type_error(list,Options)`
An element `Option` of the list `Options` is neither a variable nor a compound term:
`type_error(compound,Option)`
An element `Option` of the list `Options` is a compound term but not a valid option:
`domain_error(option,Option)`
`JWKSet` is not a JSON Web Key Set with a `keys` list:
`domain_error(jwt_jwks,JWKSet)`
`Header` does not contain a valid `alg` member:
`domain_error(jwt_header,Header)`
The JWT algorithm is unsupported or disallowed:
`domain_error(jwt_algorithm,Algorithm)`
No compatible key exists for `Header`:
`existence_error(jwt_jwk,Header)`

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)