HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulejose-jwt-0.10.0Haskell2010

Jose.Jws

JWS HMAC and RSA signed token support.

Example usage with HMAC:

Example6 expressions
import Jose.Jwsimport Jose.Jwalet Right (Jwt jwt) = hmacEncode HS256 "secretmackey" "public claims"jwt"eyJhbGciOiJIUzI1NiJ9.cHVibGljIGNsYWltcw.GDV7RdBrCYfCtFCZZGPy_sWry4GwfX3ckMywXUyxBsc"hmacDecode "wrongkey" jwtLeft BadSignaturehmacDecode "secretmackey" jwtRight (JwsHeader {jwsAlg = HS256, jwsTyp = Nothing, jwsCty = Nothing, jwsKid = Nothing},"public claims")
  • 10 values
  • Packagejose-jwt-0.10.0
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceJws.hs
valuejwkEncode
  1. :: MonadRandom m
  2. => JwsAlg

    The algorithm to use

  3. -> Jwk

    The key to sign with

  4. -> Payload

    The public JWT claims

  5. -> m (Either JwtError Jwt)

    The encoded token, if successful

#

Create a JWS signed with a JWK. The key and algorithm must be consistent or an error will be returned.