JOSEUtils.JWKS (jose_utils v0.4.0) View Source

Convenience function to work with JWK sets

Link to this section Summary

Functions

Returns the keys suitable for decryption from a JWK set

Returns the keys suitable for encryption from a JWK set

Filters the JWKS using a key selector t:JWK.key_selector/0

Returns the keys suitable for signature from a JWK set

Returns the keys suitable for signature verification from a JWK set

Link to this section Types

Link to this section Functions

Link to this function

decryption_keys(jwks, alg_or_algs \\ nil, enc_or_encs \\ nil)

View Source

Specs

decryption_keys(
  t(),
  alg_or_algs :: JOSEUtils.JWA.enc_alg() | [JOSEUtils.JWA.enc_alg()] | nil,
  enc_or_encs :: JOSEUtils.JWA.enc_enc() | [JOSEUtils.JWA.enc_enc()] | nil
) :: t()

Returns the keys suitable for decryption from a JWK set

Link to this function

encryption_keys(jwks, alg_or_algs \\ nil, enc_or_encs \\ nil)

View Source

Specs

encryption_keys(
  t(),
  alg_or_algs :: JOSEUtils.JWA.enc_alg() | [JOSEUtils.JWA.enc_alg()] | nil,
  enc_or_encs :: JOSEUtils.JWA.enc_enc() | [JOSEUtils.JWA.enc_enc()] | nil
) :: t()

Returns the keys suitable for encryption from a JWK set

Link to this function

filter(jwks, key_selector)

View Source

Specs

filter(t(), JOSEUtils.JWK.key_selector()) :: t()

Filters the JWKS using a key selector t:JWK.key_selector/0

Link to this function

signature_keys(jwks, alg_or_algs \\ nil)

View Source

Specs

signature_keys(
  t(),
  alg_or_algs :: JOSEUtils.JWA.sig_alg() | [JOSEUtils.JWA.sig_alg()] | nil
) :: t()

Returns the keys suitable for signature from a JWK set

Note that it does not return the keys suitable only for signature verification.

MAC keys are considered signature keys, and are returned as well.

Link to this function

verification_keys(jwks, alg_or_algs \\ nil)

View Source

Specs

verification_keys(
  t(),
  alg_or_algs :: JOSEUtils.JWA.sig_alg() | [JOSEUtils.JWA.sig_alg()] | nil
) :: t()

Returns the keys suitable for signature verification from a JWK set

MAC keys are considered verification keys, and are returned as well.