-
Changed the header protection data types for better ergonomics (#125). Previously,
()
was used for serialisations that only support protected headers (thus, a single constructor). This release introduces the new singleton data typeRequiredProtected
to replace the use of()
for this purpose. This is a breaking change and some library users will need to update their code.The
Protection
type has been renamed toOptionalProtection
, with the old name retained as a (deprecated) type synonym.The
ProtectionIndicator
class has been renamed toProtectionSupport
, with the old name retained as a (deprecated) type synonym.Added some convenience header and header parameter constructors:
newJWSHeaderProtected
,newHeaderParamProtected
andnewHeaderParamUnprotected
. -
Generalised the types of
signJWT
,verifyJWT
and related functions to accept custom JWS header types. Added new type synonymSignedJWTWithHeader h
. This change could break some applications by introducing ambiguity. The solution is to use a type annotation, type application, or explicit coercion function, as in the below examples:-- type application {-# LANGUAGE TypeApplications #-} decodeCompact @SignedJWT s >>= verifyClaims settings k -- type annotation do jwt <- decodeCompact s verifyClaims settings k (jwt :: SignedJWT) -- coercion function let fixType = id :: SignedJWT -> SignedJWT in verifyClaims settings k . fixType =<< decodeCompact s
-
Added
unsafeGetPayload
,unsafeGetJWTPayload
andunsafeGetJWTClaimsSet
functions. These enable access to the JWS/JWT payload without cryptographic verification. As the name imlies, these should be used with the utmost caution! (#126) -
Add
Crypto.JOSE.JWK.negotiateJWSAlg
which chooses the cryptographically strongest JWS algorithm for a given key, restricted to a given set of algorithms. (#118) -
Added new conversion functions
Crypto.JOSE.JWK.fromX509PubKey
andCrypto.JOSE.JWK.fromX509PrivKey
. These convert from theData.X509.PubKey
andData.X509.PrivKey
types, which can be read via the crypton-x509-store package. They supports RSA, NIST ECC, and Edwards curve key types (Ed25519, Ed448, X25519, X448). -
Updated
Crypto.JOSE.JWK.fromX509Certificate
to support Edwards curve key types (Ed25519, Ed448, X25519, X448). -
Added
Crypto.JOSE.JWK.fromRSAPublic :: RSA.PublicKey -> JWK
.
-
Migrate to the crypton library ecosystem. crypton was a hard fork of cryptonite, which was no longer maintained. With this change, the minimum supported version of GHC increased to 8.8. There are no other notable changes in this release.
-
The
v0.10
series is the last release series to support cryptonite. It will continue to receive important bug fixes until the end of 2024.
-
Introduce
newtype JOSE e m a
which behaves likeExceptT e m a
but also hasinstance (MonadRandom m) => MonadRandom (JOSE e m)
. The orphanMonadRandom
instances were removed. (#91) -
Parameterise
JWT
over the claims data type. This is a cleaner mechanism to support applications that use additional claims beyond those registered by RFC 7519.unregisteredClaims
andaddClaim
are deprecated and will be removed in a future release. (#39) -
Add Ed448 and X448 support. (#74)
-
Add secp256k1 curve support (RFC 8812).
-
Added
checkJWK :: (MonadError e m, AsError e) => JWK -> m ()
. This action performs some key usability checks. In particular it identifies too-small symmetric keys. (#46) -
Removed
QuickCheck
instances. jose no longer depends onQuickCheck
. (#106) -
Removed orphan
ToJSON
andFromJSON
instances forURI
. -
Fail signature verification when curve does not match algorithm. This is an additional defence against curve substitution attacks.
-
Improved error reporting when constructing a JWK from an X.509 certificate with ECDSA key.
-
Make compatible with
mtl == 2.3.*
(#107) -
Make compatible with
monad-time == 0.4
See Git commit history