githubEdit

JSON Web Signatures

From Wikipediaarrow-up-right:

A JSON Web Signature (abbreviated JWS) is an IETFarrow-up-right-proposed standard (RFCarrow-up-right 7515arrow-up-right) for signingarrow-up-right arbitrary data.[1]arrow-up-right This is used as the basis for a variety of web-based technologies including JSON Web Tokenarrow-up-right.

{% capture private_key_pem = options.private_key_pem__required_code_multiline %}

{% assign claims = options.payload_json__code_multiline | parse_json | json | base64_url_safe_encode %}
{% assign header = '{"alg":"RS256","typ":"JWT"}' | base64_encode %}
{% assign input = header | append: "." | append: claims %}

{% assign signature = input | rsa_sha256: private_key_pem | base64_url_safe_encode %}

{% log header: header, claims: claims, input: input, signature: signature %}

Last updated

Was this helpful?