Key-derived JOSE signing algorithm helpers.
Attesto treats the algorithm as metadata of the trusted key selected by
kid, never as policy learned from the presented token. RSA keys infer
RS256 (RSASSA-PKCS1-v1_5) as the JWA default for the RSA key type, while
EC/OKP keys infer their JOSE algorithm from the public JWK curve. RSA
deployments that intentionally use PS256 can label the key through the
keystore's alg metadata.
Summary
Functions
Algorithms Attesto can sign/verify when backed by a matching key.
Default set of algorithms accepted for signatures a client presents (client assertions and request objects).
Signing algorithms permitted for FAPI 2 client authentication and request objects: PS256, ES256, EdDSA.
Resolve the algorithm for a key in keystore.
Return the digest algorithm used by an ID Token hash claim.
Return the number of left-most bytes used for OIDC hash claims.
Infer the default algorithm from a parsed JWK's public members.
Validate that alg is one of Attesto's supported asymmetric JOSE algorithms.
Types
@type alg() :: String.t()
Functions
@spec allowed() :: [alg()]
Algorithms Attesto can sign/verify when backed by a matching key.
@spec default_client_algs() :: [alg()]
Default set of algorithms accepted for signatures a client presents (client assertions and request objects).
Equal to fapi_algs/0: PS256, ES256, EdDSA. A host with a non-FAPI profile
can widen this by passing an explicit :accepted_algs opt to the relevant
verifier; the default keeps the FAPI 2 gate.
@spec fapi_algs() :: [alg()]
Signing algorithms permitted for FAPI 2 client authentication and request objects: PS256, ES256, EdDSA.
RS256 (RSASSA-PKCS1-v1_5) is deliberately excluded - FAPI 2 mandates PS256
for RSA keys. This is the policy gate for verifying a signature a client
presents; it is narrower than allowed/0, which still admits RS256 for the
provider's own token signing.
Resolve the algorithm for a key in keystore.
Resolution order:
- per-key metadata from
key_algs/0, keyed by RFC 7638kid signing_alg/0for the current signing key only- inference from the JWK type/curve
@spec hash_alg(alg()) :: :sha256 | :sha384 | :sha512
Return the digest algorithm used by an ID Token hash claim.
@spec hash_half_bytes(alg()) :: pos_integer()
Return the number of left-most bytes used for OIDC hash claims.
@spec infer(JOSE.JWK.t()) :: alg()
Infer the default algorithm from a parsed JWK's public members.
Validate that alg is one of Attesto's supported asymmetric JOSE algorithms.