Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benmcollins/libjwt
JWT C Library
https://github.com/benmcollins/libjwt
Last synced: 24 days ago
JSON representation
JWT C Library
- Host: GitHub
- URL: https://github.com/benmcollins/libjwt
- Owner: benmcollins
- License: mpl-2.0
- Created: 2015-05-18T02:42:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T13:58:43.000Z (3 months ago)
- Last Synced: 2024-11-17T17:35:57.516Z (25 days ago)
- Language: C
- Size: 1.26 MB
- Stars: 354
- Watchers: 28
- Forks: 162
- Open Issues: 13
-
Metadata Files:
- Readme: README.cmake.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jwt - libjwt - C Library. (Libraries / C)
README
Build Instructions for CMake
============================1. Generate build tree.
mkdir out
cd out
cmake -G "Ninja" -DBUILD_TESTS=1 ..NOTE: If you prefer, substitute "Unix Makefiles" or other cmake build generator.
2. Build all.
ninja
NOTE: If using different build tool, `cmake --build .` will work.
3. Run tests.
ninja check
NOTE: If using different build tool, `cmake --build . --target check` will work.
Examples
--------Two example utilities are provided to demonstrate generating JWT and for
authenticating JWT, jwtgen and jwtauth.1. Generate a token using RS256 signature with the sample private key.
cd out/examples
./jwtgen -k ../../tests/keys/rsa_key_2048.pem -a RS256 -c iss=example.com -c sub=user0 > user0.jwt2. Authenticate a token using RS256 signature with the sample public key.
cd out/examples
./jwtauth -k ../../tests/keys/rsa_key_2048-pub.pem --alg RS256 user0.jwt3. Authenticate a token using RS256 signature with the sample public key, verifying user is user1.
cd out/examples
./jwtauth -k ../../tests/keys/rsa_key_2048-pub.pem --alg RS256 -c sub=user1 user0.jwt