JOSE implementation in Python providing JWT, JWS, JWE, and JWK functionality with multiple cryptographic backends.
75
Build a module that loads multiple JOSE keys from varied inputs, prefers one crypto backend but falls back to another when needed, and allows registering an extra symmetric key type. Expose functions to add keys, fetch keys by kid/alg/use, and export public JWKS data.
kid, alg, and use, rejecting unknown algorithms. @testkid. @test"oct-cat" allows constructing and using that key alongside standard keys, with kid tagging and algorithm validation. @test@generates
class KeyRegistry:
def __init__(self, preferred_backend: str | None = None, allow_fallback: bool = True): ...
def add_key(self, kid: str, alg: str, use: str, material: object) -> None: ...
def register_custom_symmetric(self, label: str, alg: str, secret: bytes | str) -> str: ...
def get_key(self, kid: str) -> object: ...
def export_public_jwks(self) -> dict: ...
def describe_backends(self) -> dict: ...Provides JOSE key construction, backend selection, and custom key registration.
Install with Tessl CLI
npx tessl i tessl/pypi-python-jose