libjwt-typed-0.2: A Haskell implementation of JSON Web Token (JWT)
Safe HaskellNone
LanguageHaskell2010

Libjwt.Algorithms

Description

Algorithms used to sign and validate JWT signatures

Synopsis

Documentation

data Algorithm k where Source #

Cryptographic algorithm used to secure the JWT

Constructors

HMAC256 :: Secret -> Algorithm Secret

HMAC SHA-256 (secret key must be at least 256 bits in size)

HMAC384 :: Secret -> Algorithm Secret

HMAC SHA-384 (secret key must be at least 384 bits in size)

HMAC512 :: Secret -> Algorithm Secret

HMAC SHA-512 (secret key must be at least 512 bits in size)

RSA256 :: RsaKey r => r -> Algorithm r

RSASSA-PKCS1-v1_5 SHA-256 (a key of size 2048 bits or larger must be used with this algorithm)

RSA384 :: RsaKey r => r -> Algorithm r

RSASSA-PKCS1-v1_5 SHA-384 (a key of size 2048 bits or larger must be used with this algorithm)

RSA512 :: RsaKey r => r -> Algorithm r

RSASSA-PKCS1-v1_5 SHA-512 (a key of size 2048 bits or larger must be used with this algorithm)

ECDSA256 :: EcKey e => e -> Algorithm e

ECDSA with P-256 curve and SHA-256

ECDSA384 :: EcKey e => e -> Algorithm e

ECDSA with P-384 curve and SHA-384

ECDSA512 :: EcKey e => e -> Algorithm e

ECDSA with P-521 curve and SHA-512

AlgNone :: Algorithm ()

None

Instances

Instances details
Show k => Show (Algorithm k) Source # 
Instance details

Defined in Libjwt.Algorithms

type family RsaKey t :: Constraint where ... Source #

Equations

RsaKey RsaKeyPair = () 
RsaKey RsaPubKey = () 
RsaKey a = TypeError ('Text "RSASSA-PKCS-v1_5 cannot be used with " :<>: 'ShowType a) 

type family EcKey t :: Constraint where ... Source #

Equations

EcKey EcKeyPair = () 
EcKey EcPubKey = () 
EcKey a = TypeError ('Text "ECDSA cannot be used with " :<>: 'ShowType a) 

jwtAlgWithKey :: Algorithm k -> (JwtAlgT, k) Source #