diff --git a/README.md b/README.md index 3ef9009..ec87f63 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ - [Error Codes & Exceptions](#errorcodeexception) - [Additional Header Data](#additionalheaderdata) - [Things for improvement](#improvement) +- [LICENSE](#license) ## What is it ? @@ -146,4 +147,39 @@ Few good resources on this material which I found useful are: } ``` +The jwt_object class is basically a composition of the JWT component classes, which are jwt_header & jwt_payload. For convenience jwt_object exposes only few important APIs to the user, the remaining APIs under jwt_header and jwt_payload can be accessed by calling jwt_object::header() and jwt_object::payload() APIs. + + +## API Philosophy +I wanted to make the code easy to read and at the same time make most of the standard library and the modern features. +It also uses some metaprogramming tricks to enforce type checks and give better error messages. + +The design of `parameters` alleviates the pain of remembering positional arguments. Also makes the APIs more extensible for future enhancements. + +The library has 2 sets of APIs for encoding and decoding: + - API which takes an instance of std::error_code + These APIs will report the errors by setting the `error_code`. This does not mean that these API would not throw. Memory allocation errors would still be thrown instead of setting the error_code. + - API which throws exceptions + All the errors would be thrown as exception. + +## Support +Algorithms and features supported +- [x] HS256 +- [x] HS384 +- [x] HS512 +- [x] RS256 +- [x] RS384 +- [x] RS512 +- [x] ES256 +- [x] ES384 +- [x] ES512 +- [x] Sign +- [x] Verify +- [x] iss (issuer) check +- [x] sub (subject) check +- [x] aud (audience) check +- [x] exp (expiration time) check +- [x] nbf (not before time) check +- [x] iat (issued at) check +- [x] jti (JWT id) check