Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detached payload support for JWS encoding and decoding #723

Merged
merged 1 commit into from
Mar 26, 2022

Commits on Feb 26, 2022

  1. Add detached payload support for JWS encoding and decoding

    Specifications allow to have JWS with unencoded detached payloads.
    This changeset adds detached payload support for encoding and decoding
    functions.
    
    For encoding, detached payload can be enabled by setting the
    "is_payload_detached" arg or having the "b64=False" inside the headers.
    
    For decoding, the detached payload content (bytes) has to be provided
    with the "detached_payload" arg and "b64=False" has to be found inside
    the decoded headers.
    
    Functionnally, when this feature is used, the signature will be computed
    over the raw data bytes of the payload, without being base64 encoded and
    obviously, the payload will not be provided inside the generated JWS.
    So, the generated JWS will look like:
    base64url(header)..base64url(signature)
    
    Relevant specifications:
    RFC 7515: "JSON Web Signature (JWS)". (Annexe F)
    RFC 7797: "JSON Web Signature (JWS) Unencoded Payload Option".
    fviard committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    cbbdb5b View commit details
    Browse the repository at this point in the history