mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
README updated
This commit is contained in:
17
README.md
17
README.md
@@ -1,6 +1,10 @@
|
||||
# jwt-cpp
|
||||
A header only library for creating and validating json web tokens in c++.
|
||||
|
||||
## Signature algorithms
|
||||
jwt-cpp currently supports all algorithms used in normal applications. It does not yet support the optional PS256, PS384, PS512 defined in later versions of the specification. Those are not used in the wild yet and the modular design of jwt-cpp allows one to add them without any problems. If you need them feel free to open a pull request.
|
||||
|
||||
## Examples
|
||||
Simple example of decoding a token and printing all claims:
|
||||
```c++
|
||||
#include <jwt-cpp/jwt.h>
|
||||
@@ -33,3 +37,16 @@ auto token = jwt::create()
|
||||
.set_payload_claim("sample", std::string("test"))
|
||||
.sign(jwt::algorithm::hs256{"secret"});
|
||||
```
|
||||
|
||||
## Contributing
|
||||
If you have an improvement or found a bug feel free to [open an issue](https://github.com/Thalhammer/jwt-cpp/issues/new) or add the change and create a pull request. If you file a bug please make sure to include as much information about your environment (compiler version, etc.) as possible to help reproduce the issue. If you add a new feature please make sure to also include test cases for it.
|
||||
|
||||
## Dependencies
|
||||
In order to use jwt-cpp you need the following tools.
|
||||
* libcrypto (openssl or compatible)
|
||||
* a compiler supporting at least c++11
|
||||
* basic stl support
|
||||
|
||||
In order to build the test cases you also need
|
||||
* gtest installed in linker path
|
||||
* pthread
|
||||
Reference in New Issue
Block a user