-
Notifications
You must be signed in to change notification settings - Fork 329
/
Copy pathtoken-editor-common.pug
40 lines (37 loc) · 1.65 KB
/
token-editor-common.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.algorithm-code
.tab-nav
.tab-link.current
a(href='#encoded-jwt') Encoded
small paste a token here
.tab-link
a(href='#decoded-jwt') Decoded
small edit the payload and secret
.tab-content
#encoded-jwt.box-content.current(heap-ignore="true")
.input.js-input
include token-editor-warnings.pug
#decoded-jwt.box-content(heap-ignore="true")
.output
.jwt-explained.jwt-header
p.text-line HEADER:
span ALGORITHM & TOKEN TYPE
.js-header
.jwt-explained.jwt-payload
p.text-line PAYLOAD:
span DATA
.js-payload
.jwt-explained.jwt-signature
p.text-line VERIFY SIGNATURE
pre.pre-encode.HS256.
<span id="hmacsha-text">HMACSHA256</span>(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
<input type="text" name="secret" value="your-256-bit-secret" title="Weak secret!">
)<span class="is-base64-encoded-label"> <input id="is-base64-encoded" type="checkbox" name="is-base64-encoded"><label for="is-base64-encoded">secret base64 encoded</label></span>
pre.pre-encode.RS256.
<span id="rsasha-text">RSASHA256</span>(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
<textarea rows="4" name="public-key" placeholder="Public Key in SPKI, PKCS #1, X.509 Certificate, or JWK string format."></textarea>,
<textarea rows="5" name="private-key" placeholder="Private Key in PKCS #8, PKCS #1, or JWK string format. The key never leaves your browser."></textarea>
)