File: README.cmake.md

package info (click to toggle)
libjwt 1.17.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 808 kB
  • sloc: ansic: 5,688; makefile: 90; sh: 16
file content (44 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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.jwt

2. 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.jwt

3. 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