JSON Web Key¶
JSON Web Key.
-
class
josepy.jwk.JWK(**kwargs)[source]¶ Bases:
josepy.json_util.TypedJSONObjectWithFieldsJSON Web Key.
-
cryptography_key_types= ()¶ Subclasses should override.
-
required= NotImplemented¶ Required members of public key’s representation as defined by JWK/JWA.
-
thumbprint(hash_function=<class 'cryptography.hazmat.primitives.hashes.SHA256'>)[source]¶ Compute JWK Thumbprint.
https://tools.ietf.org/html/rfc7638
Returns: bytes
-
public_key()[source]¶ Generate JWK with public key.
For symmetric cryptosystems, this would return
self.
-
classmethod
load(data, password=None, backend=None)[source]¶ Load serialized key as JWK.
Parameters: - data (str) – Public or private key serialized as PEM or DER.
- password (str) – Optional password.
- backend – A
PEMSerializationBackendandDERSerializationBackendprovider.
Raises: errors.Error – if unable to deserialize, or unsupported JWK algorithm
Returns: JWK of an appropriate type.
Return type:
-
-
class
josepy.jwk.JWKES(**kwargs)[source]¶ Bases:
josepy.jwk.JWKES JWK.
Warning
This is not yet implemented!
-
class
josepy.jwk.JWKOct(**kwargs)[source]¶ Bases:
josepy.jwk.JWKSymmetric JWK.
-
class
josepy.jwk.JWKRSA(*args, **kwargs)[source]¶ Bases:
josepy.jwk.JWKRSA JWK.
Variables: key – RSAPrivateKeyorRSAPublicKeywrapped inComparableRSAKey