- On Apple platforms, JSONWebToken will use the system CommonCrypto where possible.
- Allow passing additional headers when encoding a JWT.
- Allow passing leeway parameter for date checks when verifying a JWT.
-
Introduces a new
ClaimSet
structure. The structure can be returned fromdecode
providing you convenience accessors.encode
will now accept aClaimSet
.ClaimSet
provides methods to manually validate individual claims.try claims.validateAudience("example.com") try claims.validateIssuer("fuller.li") try claims.validateExpiary() try claims.validateNotBefore() try claims.validateIssuedAt()
- Adds support for Linux.
This release adds support for Swift 3.0.
-
Algorithms now take
Data
instead of aString
. This improves the API allowing you to use keys that cannot be serialised as a String.You can easily convert a String to Data such as in the following example:
.hs256("secret".data(using: .utf8)!)
This release updates the dependency on CryptoSwift to ~> 0.4.0 which adds support for Swift 2.2.