← all modules
Sky.Core.Jwt
Sky.Core.Jwt
Sky.Core.Jwt — JSON Web Tokens (encode + verify).
Types
type Algorithm
type Claims
Values
audience : String -> Claims -> Claims
claims : Claims
decode : Algorithm -> Int -> String -> Result Error String
Verify a token's signature and its `exp` / `nbf` against `now`
encode : Algorithm -> Claims -> Result Error String
Sign a `Claims` set into a compact JWT string.
expiresAt : Int -> Claims -> Claims
`exp` — expiry, unix seconds.
hs256 : Secret -> Algorithm
issuedAt : Int -> Claims -> Claims
`iat` — issued-at, unix seconds.
issuer : String -> Claims -> Claims
jwtId : String -> Claims -> Claims
notBefore : Int -> Claims -> Claims
`nbf` — not-before, unix seconds.
rs256 : Secret -> Algorithm
`rs256 privateKeyPem` — the RSA SIGNING algorithm. The PEM private key is a
rs256Verify : String -> Algorithm
`rs256Verify publicKeyPem` — the RSA VERIFYING algorithm. The PEM public
subject : String -> Claims -> Claims
withClaim : String -> JsonEnc.Value -> Claims -> Claims