JSON Web Signature¶
JOSE Web Signature.
-
class
acme.jose.jws.
MediaType
[source]¶ Bases:
object
MediaType field encoder/decoder.
-
PREFIX
= 'application/'¶ MIME Media Type and Content Type prefix.
-
-
class
acme.jose.jws.
Header
(**kwargs)[source]¶ Bases:
acme.jose.json_util.JSONObjectWithFields
JOSE Header.
Warning
This class supports only Registered Header Parameter Names (as defined in section 4.1 of the protocol). If you need Public Header Parameter Names (4.2) or Private Header Parameter Names (4.3), you must subclass and override
from_json()
andto_partial_json()
appropriately.Warning
This class does not support any extensions through the “crit” (Critical) Header Parameter (4.1.11) and as a conforming implementation,
from_json()
treats its occurrence as an error. Please subclass if you seek for a different behaviour.Variables: - x5tS256 – “x5t#S256”
- typ (str) – MIME Media Type, inc.
MediaType.PREFIX
. - cty (str) – Content-Type, inc.
MediaType.PREFIX
.
-
find_key
()[source]¶ Find key based on header.
Todo
Supports only “jwk” header parameter lookup.
Returns: (Public) key found in the header. Return type: JWK Raises: acme.jose.errors.Error – if key could not be found
-
class
acme.jose.jws.
Signature
(**kwargs)[source]¶ Bases:
acme.jose.json_util.JSONObjectWithFields
JWS Signature.
Variables:
-
class
acme.jose.jws.
JWS
(**kwargs)[source]¶ Bases:
acme.jose.json_util.JSONObjectWithFields
JSON Web Signature.
Variables: - payload (str) – JWS Payload.
- signature (str) – JWS Signatures.
-
signature
¶ Get a singleton signature.
Return type: signature_cls