RFC7517: JSON Web Key

This section contains the generic implementation of RFC7517. Find how to use it in JWK Guide.

API Reference

class authlib.jose.rfc7517.JWK(algorithms)
loads(obj, kid=None)

Loads JSON Web Key object into a public/private key.

Parameters:
  • obj – A JWK (or JWK set) format dict
  • kid – kid of a JWK set
Returns:

key

dumps(key, kty=None, **params)

Generate JWK format for the given public/private key.

Parameters:
  • key – A public/private key
  • kty – key type of the key
  • params – Other parameters
Returns:

JWK dict

class authlib.jose.rfc7517.JWKAlgorithm
name = None

Interface for JWK algorithm. JWA specification (RFC7518) SHOULD implement the algorithms for JWK with this base implementation.

prepare_key(key)

Prepare key before dumping it into JWK.

loads(obj)

Load JWK dict object into a public/private key.

dumps(key)

Dump a public/private key into JWK dict object.