object

# `jwt_jwa`

JSON Web Algorithm metadata and header 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:
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

### `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(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`

### `validate_header/1`

Validates a JWT header object and rejects unsupported critical header parameters.

Compilation flags:
`static`
Template:
`validate_header(Header)`
Mode and number of proofs:
`validate_header(+term)` - `one_or_error`
Exceptions:
`Header` is not a JSON object, contains duplicate member names, or contains unsupported critical header parameters:
`domain_error(jwt_header,Header)`

### `allowed_algorithm/2`

Validates that an algorithm is supported and allowed by the options.

Compilation flags:
`static`
Template:
`allowed_algorithm(Algorithm,Options)`
Mode and number of proofs:
`allowed_algorithm(+atom,+list(compound))` - `one_or_error`
Exceptions:
`Algorithm` is unsupported or disallowed by `Options`:
`domain_error(jwt_algorithm,Algorithm)`

### `supported_algorithm/1`

Succeeds when the algorithm is supported by this library.

Compilation flags:
`static`
Template:
`supported_algorithm(Algorithm)`
Mode and number of proofs:
`supported_algorithm(+atom)` - `zero_or_one`

### `key_type/2`

Maps a supported algorithm to the required JWK key type.

Compilation flags:
`static`
Template:
`key_type(Algorithm,KeyType)`
Mode and number of proofs:
`key_type(+atom,-atom)` - `zero_or_one`

### `hmac_hash/2`

Maps a supported HMAC algorithm to its hash object.

Compilation flags:
`static`
Template:
`hmac_hash(Algorithm,Hash)`
Mode and number of proofs:
`hmac_hash(+atom,-object_identifier)` - `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)