mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-14 16:58:34 +00:00
Readme changes for example code and fixed header decoding
This commit is contained in:
parent
1236071a4f
commit
6302055db1
22 changed files with 1077 additions and 6 deletions
|
@ -17,3 +17,5 @@ link_directories(${OPENSSL_LIBRARIES})
|
||||||
# cause another cmake executable to run. The same process will walk through
|
# cause another cmake executable to run. The same process will walk through
|
||||||
# the project's entire directory structure.
|
# the project's entire directory structure.
|
||||||
add_subdirectory (tests)
|
add_subdirectory (tests)
|
||||||
|
|
||||||
|
add_subdirectory (examples)
|
||||||
|
|
49
README.md
49
README.md
|
@ -37,3 +37,52 @@ Few good resources on this material which I found useful are:
|
||||||
- <a href="https://scotch.io/tutorials/the-anatomy-of-a-json-web-token">Anatomy of JWT</a>
|
- <a href="https://scotch.io/tutorials/the-anatomy-of-a-json-web-token">Anatomy of JWT</a>
|
||||||
- <a href="https://auth0.com/learn/json-web-tokens/">Learn JWT</a>
|
- <a href="https://auth0.com/learn/json-web-tokens/">Learn JWT</a>
|
||||||
- <a href="https://tools.ietf.org/html/rfc7519">RFC 7519</a>
|
- <a href="https://tools.ietf.org/html/rfc7519">RFC 7519</a>
|
||||||
|
|
||||||
|
|
||||||
|
## Example
|
||||||
|
Lets dive into see a simple example of encoding and decoding in Python. Taking the example of <strong>pyjwt</strong> module from its docs.
|
||||||
|
|
||||||
|
```python
|
||||||
|
>>import jwt
|
||||||
|
>>key = 'secret'
|
||||||
|
>>
|
||||||
|
>>encoded = jwt.encode({'some': 'payload'}, key, algorithm='HS256')
|
||||||
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg'
|
||||||
|
>>
|
||||||
|
>>decoded = jwt.decode(encoded, key, algorithms='HS256')
|
||||||
|
{'some': 'payload'}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, lets look at our C++ code doing the same thing.
|
||||||
|
```cpp
|
||||||
|
#include <iostream>
|
||||||
|
#include "jwt/jwt.hpp"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
using namespace jwt::params;
|
||||||
|
|
||||||
|
auto key = "secret"; //Secret to use for the algorithm
|
||||||
|
//Create JWT object
|
||||||
|
jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), secret(key)};
|
||||||
|
|
||||||
|
//Get the encoded string/assertion
|
||||||
|
auto enc_str = obj.signature();
|
||||||
|
std::cout << enc_str << std::endl;
|
||||||
|
|
||||||
|
//Decode
|
||||||
|
auto dec_obj = jwt::decode(enc_str, algorithms({"hs256"}), secret(key));
|
||||||
|
std::cout << dec_obj.header() << std::endl;
|
||||||
|
std::cout << dec_obj.payload() << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
It outputs:
|
||||||
|
```
|
||||||
|
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
|
||||||
|
{"alg":"HS256","typ":"JWT"}
|
||||||
|
{"some":"payload"}
|
||||||
|
```
|
||||||
|
|
||||||
|
Almost the same API, except for some ugliness here and there. But close enough!
|
||||||
|
|
16
examples/CMakeFiles/CMakeDirectoryInformation.cmake
Normal file
16
examples/CMakeFiles/CMakeDirectoryInformation.cmake
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
|
||||||
|
|
||||||
|
# Relative path conversion top directories.
|
||||||
|
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/amuralid/dev_test/cpp-jwt")
|
||||||
|
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/amuralid/dev_test/cpp-jwt")
|
||||||
|
|
||||||
|
# Force unix paths in dependencies.
|
||||||
|
set(CMAKE_FORCE_UNIX_PATHS 1)
|
||||||
|
|
||||||
|
|
||||||
|
# The C and CXX include file regular expressions for this directory.
|
||||||
|
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
|
||||||
|
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
|
||||||
|
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
|
||||||
|
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
|
1
examples/CMakeFiles/progress.marks
Normal file
1
examples/CMakeFiles/progress.marks
Normal file
|
@ -0,0 +1 @@
|
||||||
|
2
|
492
examples/CMakeFiles/simple_ex1.dir/CXX.includecache
Normal file
492
examples/CMakeFiles/simple_ex1.dir/CXX.includecache
Normal file
|
@ -0,0 +1,492 @@
|
||||||
|
#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">])
|
||||||
|
|
||||||
|
#IncludeRegexScan: ^.*$
|
||||||
|
|
||||||
|
#IncludeRegexComplain: ^$
|
||||||
|
|
||||||
|
#IncludeRegexTransform:
|
||||||
|
|
||||||
|
/Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc
|
||||||
|
iostream
|
||||||
|
-
|
||||||
|
jwt/jwt.hpp
|
||||||
|
/Users/amuralid/dev_test/cpp-jwt/examples/jwt/jwt.hpp
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/asn1.h
|
||||||
|
time.h
|
||||||
|
-
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/stack.h
|
||||||
|
-
|
||||||
|
openssl/safestack.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/bio.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
stdio.h
|
||||||
|
-
|
||||||
|
stdarg.h
|
||||||
|
-
|
||||||
|
openssl/crypto.h
|
||||||
|
-
|
||||||
|
stdint.h
|
||||||
|
-
|
||||||
|
inttypes.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/bn.h
|
||||||
|
limits.h
|
||||||
|
-
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
stdio.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/crypto.h
|
||||||
|
-
|
||||||
|
assert.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/buffer.h
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
stddef.h
|
||||||
|
-
|
||||||
|
sys/types.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/crypto.h
|
||||||
|
stdlib.h
|
||||||
|
-
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
stdio.h
|
||||||
|
-
|
||||||
|
openssl/stack.h
|
||||||
|
-
|
||||||
|
openssl/safestack.h
|
||||||
|
-
|
||||||
|
openssl/opensslv.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/ebcdic.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/dh.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/dsa.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/crypto.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
openssl/dh.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/e_os2.h
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
sys/socket.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ebcdic.h
|
||||||
|
sys/types.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ec.h
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/asn1.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ecdh.h
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/ec.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ecdsa.h
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/ec.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/evp.h
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/objects.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/hmac.h
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/evp.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/lhash.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
stdio.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/obj_mac.h
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/objects.h
|
||||||
|
openssl/obj_mac.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/asn1.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/opensslconf.h
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/opensslv.h
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ossl_typ.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/pem.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/stack.h
|
||||||
|
-
|
||||||
|
openssl/evp.h
|
||||||
|
-
|
||||||
|
openssl/x509.h
|
||||||
|
-
|
||||||
|
openssl/pem2.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/pem2.h
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/pkcs7.h
|
||||||
|
openssl/asn1.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/rsa.h
|
||||||
|
openssl/asn1.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/crypto.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/safestack.h
|
||||||
|
openssl/stack.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/sha.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
stddef.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/stack.h
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/symhacks.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/x509.h
|
||||||
|
openssl/e_os2.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
openssl/buffer.h
|
||||||
|
-
|
||||||
|
openssl/evp.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/stack.h
|
||||||
|
-
|
||||||
|
openssl/asn1.h
|
||||||
|
-
|
||||||
|
openssl/safestack.h
|
||||||
|
-
|
||||||
|
openssl/ec.h
|
||||||
|
-
|
||||||
|
openssl/ecdsa.h
|
||||||
|
-
|
||||||
|
openssl/ecdh.h
|
||||||
|
-
|
||||||
|
openssl/rsa.h
|
||||||
|
-
|
||||||
|
openssl/dsa.h
|
||||||
|
-
|
||||||
|
openssl/dh.h
|
||||||
|
-
|
||||||
|
openssl/sha.h
|
||||||
|
-
|
||||||
|
openssl/ossl_typ.h
|
||||||
|
-
|
||||||
|
openssl/x509_vfy.h
|
||||||
|
-
|
||||||
|
openssl/pkcs7.h
|
||||||
|
-
|
||||||
|
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/x509_vfy.h
|
||||||
|
openssl/x509.h
|
||||||
|
-
|
||||||
|
openssl/opensslconf.h
|
||||||
|
-
|
||||||
|
openssl/lhash.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/crypto.h
|
||||||
|
-
|
||||||
|
openssl/symhacks.h
|
||||||
|
-
|
||||||
|
|
||||||
|
include/jwt/algorithm.hpp
|
||||||
|
cassert
|
||||||
|
-
|
||||||
|
system_error
|
||||||
|
-
|
||||||
|
openssl/bn.h
|
||||||
|
-
|
||||||
|
openssl/bio.h
|
||||||
|
-
|
||||||
|
openssl/pem.h
|
||||||
|
-
|
||||||
|
openssl/evp.h
|
||||||
|
-
|
||||||
|
openssl/hmac.h
|
||||||
|
-
|
||||||
|
openssl/ecdsa.h
|
||||||
|
-
|
||||||
|
openssl/buffer.h
|
||||||
|
-
|
||||||
|
jwt/exceptions.hpp
|
||||||
|
include/jwt/jwt/exceptions.hpp
|
||||||
|
jwt/string_view.hpp
|
||||||
|
include/jwt/jwt/string_view.hpp
|
||||||
|
jwt/error_codes.hpp
|
||||||
|
include/jwt/jwt/error_codes.hpp
|
||||||
|
jwt/impl/algorithm.ipp
|
||||||
|
include/jwt/jwt/impl/algorithm.ipp
|
||||||
|
|
||||||
|
include/jwt/base64.hpp
|
||||||
|
array
|
||||||
|
-
|
||||||
|
cassert
|
||||||
|
-
|
||||||
|
jwt/string_view.hpp
|
||||||
|
include/jwt/jwt/string_view.hpp
|
||||||
|
|
||||||
|
include/jwt/detail/meta.hpp
|
||||||
|
iterator
|
||||||
|
-
|
||||||
|
type_traits
|
||||||
|
-
|
||||||
|
jwt/string_view.hpp
|
||||||
|
include/jwt/detail/jwt/string_view.hpp
|
||||||
|
|
||||||
|
include/jwt/error_codes.hpp
|
||||||
|
system_error
|
||||||
|
-
|
||||||
|
jwt/impl/error_codes.ipp
|
||||||
|
include/jwt/jwt/impl/error_codes.ipp
|
||||||
|
|
||||||
|
include/jwt/exceptions.hpp
|
||||||
|
new
|
||||||
|
-
|
||||||
|
string
|
||||||
|
-
|
||||||
|
|
||||||
|
include/jwt/impl/algorithm.ipp
|
||||||
|
|
||||||
|
include/jwt/impl/error_codes.ipp
|
||||||
|
|
||||||
|
include/jwt/impl/jwt.ipp
|
||||||
|
jwt/detail/meta.hpp
|
||||||
|
include/jwt/impl/jwt/detail/meta.hpp
|
||||||
|
algorithm
|
||||||
|
-
|
||||||
|
|
||||||
|
include/jwt/impl/string_view.ipp
|
||||||
|
|
||||||
|
include/jwt/json/json.hpp
|
||||||
|
algorithm
|
||||||
|
-
|
||||||
|
array
|
||||||
|
-
|
||||||
|
cassert
|
||||||
|
-
|
||||||
|
ciso646
|
||||||
|
-
|
||||||
|
clocale
|
||||||
|
-
|
||||||
|
cmath
|
||||||
|
-
|
||||||
|
cstddef
|
||||||
|
-
|
||||||
|
cstdint
|
||||||
|
-
|
||||||
|
cstdlib
|
||||||
|
-
|
||||||
|
cstring
|
||||||
|
-
|
||||||
|
forward_list
|
||||||
|
-
|
||||||
|
functional
|
||||||
|
-
|
||||||
|
initializer_list
|
||||||
|
-
|
||||||
|
iomanip
|
||||||
|
-
|
||||||
|
iosfwd
|
||||||
|
-
|
||||||
|
iterator
|
||||||
|
-
|
||||||
|
limits
|
||||||
|
-
|
||||||
|
locale
|
||||||
|
-
|
||||||
|
map
|
||||||
|
-
|
||||||
|
memory
|
||||||
|
-
|
||||||
|
numeric
|
||||||
|
-
|
||||||
|
sstream
|
||||||
|
-
|
||||||
|
string
|
||||||
|
-
|
||||||
|
type_traits
|
||||||
|
-
|
||||||
|
utility
|
||||||
|
-
|
||||||
|
valarray
|
||||||
|
-
|
||||||
|
vector
|
||||||
|
-
|
||||||
|
|
||||||
|
include/jwt/jwt.hpp
|
||||||
|
set
|
||||||
|
-
|
||||||
|
array
|
||||||
|
-
|
||||||
|
string
|
||||||
|
-
|
||||||
|
chrono
|
||||||
|
-
|
||||||
|
ostream
|
||||||
|
-
|
||||||
|
cassert
|
||||||
|
-
|
||||||
|
cstring
|
||||||
|
-
|
||||||
|
jwt/base64.hpp
|
||||||
|
include/jwt/jwt/base64.hpp
|
||||||
|
jwt/algorithm.hpp
|
||||||
|
include/jwt/jwt/algorithm.hpp
|
||||||
|
jwt/string_view.hpp
|
||||||
|
include/jwt/jwt/string_view.hpp
|
||||||
|
jwt/parameters.hpp
|
||||||
|
include/jwt/jwt/parameters.hpp
|
||||||
|
jwt/exceptions.hpp
|
||||||
|
include/jwt/jwt/exceptions.hpp
|
||||||
|
jwt/json/json.hpp
|
||||||
|
include/jwt/jwt/json/json.hpp
|
||||||
|
jwt/impl/jwt.ipp
|
||||||
|
include/jwt/jwt/impl/jwt.ipp
|
||||||
|
|
||||||
|
include/jwt/parameters.hpp
|
||||||
|
map
|
||||||
|
-
|
||||||
|
chrono
|
||||||
|
-
|
||||||
|
string
|
||||||
|
-
|
||||||
|
vector
|
||||||
|
-
|
||||||
|
utility
|
||||||
|
-
|
||||||
|
unordered_map
|
||||||
|
-
|
||||||
|
jwt/algorithm.hpp
|
||||||
|
include/jwt/jwt/algorithm.hpp
|
||||||
|
jwt/detail/meta.hpp
|
||||||
|
include/jwt/jwt/detail/meta.hpp
|
||||||
|
jwt/string_view.hpp
|
||||||
|
include/jwt/jwt/string_view.hpp
|
||||||
|
|
||||||
|
include/jwt/string_view.hpp
|
||||||
|
limits
|
||||||
|
-
|
||||||
|
string
|
||||||
|
-
|
||||||
|
cassert
|
||||||
|
-
|
||||||
|
jwt/impl/string_view.ipp
|
||||||
|
include/jwt/jwt/impl/string_view.ipp
|
||||||
|
|
22
examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake
Normal file
22
examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# The set of languages for which implicit dependencies are needed:
|
||||||
|
set(CMAKE_DEPENDS_LANGUAGES
|
||||||
|
"CXX"
|
||||||
|
)
|
||||||
|
# The set of files for implicit dependencies of each language:
|
||||||
|
set(CMAKE_DEPENDS_CHECK_CXX
|
||||||
|
"/Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc" "/Users/amuralid/dev_test/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o"
|
||||||
|
)
|
||||||
|
set(CMAKE_CXX_COMPILER_ID "Clang")
|
||||||
|
|
||||||
|
# The include file search paths:
|
||||||
|
set(CMAKE_CXX_TARGET_INCLUDE_PATH
|
||||||
|
"include"
|
||||||
|
"/usr/local/Cellar/openssl/1.0.2j/include"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Targets to which this target links.
|
||||||
|
set(CMAKE_TARGET_LINKED_INFO_FILES
|
||||||
|
)
|
||||||
|
|
||||||
|
# Fortran module output directory.
|
||||||
|
set(CMAKE_Fortran_TARGET_MODULE_DIR "")
|
113
examples/CMakeFiles/simple_ex1.dir/build.make
Normal file
113
examples/CMakeFiles/simple_ex1.dir/build.make
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
|
||||||
|
|
||||||
|
# Delete rule output on recipe failure.
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Special targets provided by cmake.
|
||||||
|
|
||||||
|
# Disable implicit rules so canonical targets will work.
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
|
|
||||||
|
# Remove some rules from gmake that .SUFFIXES does not remove.
|
||||||
|
SUFFIXES =
|
||||||
|
|
||||||
|
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||||
|
|
||||||
|
|
||||||
|
# Suppress display of executed commands.
|
||||||
|
$(VERBOSE).SILENT:
|
||||||
|
|
||||||
|
|
||||||
|
# A target that is always out of date.
|
||||||
|
cmake_force:
|
||||||
|
|
||||||
|
.PHONY : cmake_force
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Set environment variables for the build.
|
||||||
|
|
||||||
|
# The shell in which to execute make rules.
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
# The CMake executable.
|
||||||
|
CMAKE_COMMAND = /usr/local/Cellar/cmake/3.6.2/bin/cmake
|
||||||
|
|
||||||
|
# The command to remove a file.
|
||||||
|
RM = /usr/local/Cellar/cmake/3.6.2/bin/cmake -E remove -f
|
||||||
|
|
||||||
|
# Escaping for special characters.
|
||||||
|
EQUALS = =
|
||||||
|
|
||||||
|
# The top-level source directory on which CMake was run.
|
||||||
|
CMAKE_SOURCE_DIR = /Users/amuralid/dev_test/cpp-jwt
|
||||||
|
|
||||||
|
# The top-level build directory on which CMake was run.
|
||||||
|
CMAKE_BINARY_DIR = /Users/amuralid/dev_test/cpp-jwt
|
||||||
|
|
||||||
|
# Include any dependencies generated for this target.
|
||||||
|
include examples/CMakeFiles/simple_ex1.dir/depend.make
|
||||||
|
|
||||||
|
# Include the progress variables for this target.
|
||||||
|
include examples/CMakeFiles/simple_ex1.dir/progress.make
|
||||||
|
|
||||||
|
# Include the compile flags for this target's objects.
|
||||||
|
include examples/CMakeFiles/simple_ex1.dir/flags.make
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: examples/CMakeFiles/simple_ex1.dir/flags.make
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: examples/simple_ex1.cc
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/amuralid/dev_test/cpp-jwt/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o"
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt/examples && /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/simple_ex1.dir/simple_ex1.cc.o -c /Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.i: cmake_force
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/simple_ex1.dir/simple_ex1.cc.i"
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt/examples && /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc > CMakeFiles/simple_ex1.dir/simple_ex1.cc.i
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.s: cmake_force
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/simple_ex1.dir/simple_ex1.cc.s"
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt/examples && /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc -o CMakeFiles/simple_ex1.dir/simple_ex1.cc.s
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.requires:
|
||||||
|
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.requires
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.provides: examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.requires
|
||||||
|
$(MAKE) -f examples/CMakeFiles/simple_ex1.dir/build.make examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.provides.build
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.provides
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.provides.build: examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o
|
||||||
|
|
||||||
|
|
||||||
|
# Object files for target simple_ex1
|
||||||
|
simple_ex1_OBJECTS = \
|
||||||
|
"CMakeFiles/simple_ex1.dir/simple_ex1.cc.o"
|
||||||
|
|
||||||
|
# External object files for target simple_ex1
|
||||||
|
simple_ex1_EXTERNAL_OBJECTS =
|
||||||
|
|
||||||
|
examples/simple_ex1: examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o
|
||||||
|
examples/simple_ex1: examples/CMakeFiles/simple_ex1.dir/build.make
|
||||||
|
examples/simple_ex1: examples/CMakeFiles/simple_ex1.dir/link.txt
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/amuralid/dev_test/cpp-jwt/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable simple_ex1"
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt/examples && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/simple_ex1.dir/link.txt --verbose=$(VERBOSE)
|
||||||
|
|
||||||
|
# Rule to build all files generated by this target.
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/build: examples/simple_ex1
|
||||||
|
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/build
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/requires: examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o.requires
|
||||||
|
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/requires
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/clean:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt/examples && $(CMAKE_COMMAND) -P CMakeFiles/simple_ex1.dir/cmake_clean.cmake
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/clean
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/depend:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/amuralid/dev_test/cpp-jwt /Users/amuralid/dev_test/cpp-jwt/examples /Users/amuralid/dev_test/cpp-jwt /Users/amuralid/dev_test/cpp-jwt/examples /Users/amuralid/dev_test/cpp-jwt/examples/CMakeFiles/simple_ex1.dir/DependInfo.cmake --color=$(COLOR)
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/depend
|
||||||
|
|
10
examples/CMakeFiles/simple_ex1.dir/cmake_clean.cmake
Normal file
10
examples/CMakeFiles/simple_ex1.dir/cmake_clean.cmake
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
file(REMOVE_RECURSE
|
||||||
|
"CMakeFiles/simple_ex1.dir/simple_ex1.cc.o"
|
||||||
|
"simple_ex1.pdb"
|
||||||
|
"simple_ex1"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Per-language clean rules from dependency scanning.
|
||||||
|
foreach(lang CXX)
|
||||||
|
include(CMakeFiles/simple_ex1.dir/cmake_clean_${lang}.cmake OPTIONAL)
|
||||||
|
endforeach()
|
48
examples/CMakeFiles/simple_ex1.dir/depend.internal
Normal file
48
examples/CMakeFiles/simple_ex1.dir/depend.internal
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o
|
||||||
|
/Users/amuralid/dev_test/cpp-jwt/examples/simple_ex1.cc
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/asn1.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/bio.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/bn.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/buffer.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/crypto.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/dh.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/dsa.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/e_os2.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ebcdic.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ec.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ecdh.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ecdsa.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/evp.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/hmac.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/lhash.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/obj_mac.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/objects.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/opensslconf.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/opensslv.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/ossl_typ.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/pem.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/pem2.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/pkcs7.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/rsa.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/safestack.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/sha.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/stack.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/symhacks.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/x509.h
|
||||||
|
/usr/local/Cellar/openssl/1.0.2j/include/openssl/x509_vfy.h
|
||||||
|
include/jwt/algorithm.hpp
|
||||||
|
include/jwt/base64.hpp
|
||||||
|
include/jwt/detail/meta.hpp
|
||||||
|
include/jwt/error_codes.hpp
|
||||||
|
include/jwt/exceptions.hpp
|
||||||
|
include/jwt/impl/algorithm.ipp
|
||||||
|
include/jwt/impl/error_codes.ipp
|
||||||
|
include/jwt/impl/jwt.ipp
|
||||||
|
include/jwt/impl/string_view.ipp
|
||||||
|
include/jwt/json/json.hpp
|
||||||
|
include/jwt/jwt.hpp
|
||||||
|
include/jwt/parameters.hpp
|
||||||
|
include/jwt/string_view.hpp
|
48
examples/CMakeFiles/simple_ex1.dir/depend.make
Normal file
48
examples/CMakeFiles/simple_ex1.dir/depend.make
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
|
||||||
|
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: examples/simple_ex1.cc
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/asn1.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/bio.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/bn.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/buffer.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/crypto.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/dh.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/dsa.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/e_os2.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/ebcdic.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/ec.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/ecdh.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/ecdsa.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/evp.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/hmac.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/lhash.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/obj_mac.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/objects.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/opensslconf.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/opensslv.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/ossl_typ.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/pem.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/pem2.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/pkcs7.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/rsa.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/safestack.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/sha.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/stack.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/symhacks.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/x509.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: /usr/local/Cellar/openssl/1.0.2j/include/openssl/x509_vfy.h
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/algorithm.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/base64.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/detail/meta.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/error_codes.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/exceptions.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/impl/algorithm.ipp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/impl/error_codes.ipp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/impl/jwt.ipp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/impl/string_view.ipp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/json/json.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/jwt.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/parameters.hpp
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o: include/jwt/string_view.hpp
|
||||||
|
|
10
examples/CMakeFiles/simple_ex1.dir/flags.make
Normal file
10
examples/CMakeFiles/simple_ex1.dir/flags.make
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
|
||||||
|
|
||||||
|
# compile CXX with /Library/Developer/CommandLineTools/usr/bin/c++
|
||||||
|
CXX_FLAGS = -std=c++14 -DCERT_ROOT_DIR="\"/Users/amuralid/dev_test/cpp-jwt/examples/certs\""
|
||||||
|
|
||||||
|
CXX_DEFINES =
|
||||||
|
|
||||||
|
CXX_INCLUDES = -I/Users/amuralid/dev_test/cpp-jwt/include -I/usr/local/Cellar/openssl/1.0.2j/include
|
||||||
|
|
1
examples/CMakeFiles/simple_ex1.dir/link.txt
Normal file
1
examples/CMakeFiles/simple_ex1.dir/link.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/Library/Developer/CommandLineTools/usr/bin/c++ -std=c++14 -DCERT_ROOT_DIR="\"/Users/amuralid/dev_test/cpp-jwt/examples/certs\"" -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/simple_ex1.dir/simple_ex1.cc.o -o simple_ex1 -L/usr/local/Cellar/openssl/1.0.2j/lib -lssl -lcrypto -lgtest -Wl,-rpath,/usr/local/Cellar/openssl/1.0.2j/lib
|
3
examples/CMakeFiles/simple_ex1.dir/progress.make
Normal file
3
examples/CMakeFiles/simple_ex1.dir/progress.make
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
CMAKE_PROGRESS_1 = 1
|
||||||
|
CMAKE_PROGRESS_2 = 2
|
||||||
|
|
BIN
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o
Normal file
BIN
examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o
Normal file
Binary file not shown.
9
examples/CMakeLists.txt
Normal file
9
examples/CMakeLists.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
|
link_directories(${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
|
SET(CERT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/certs")
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCERT_ROOT_DIR=\"\\\"${CERT_ROOT_DIR}\\\"\"")
|
||||||
|
|
||||||
|
add_executable(simple_ex1 simple_ex1.cc)
|
||||||
|
target_link_libraries(simple_ex1 ssl crypto gtest)
|
180
examples/Makefile
Normal file
180
examples/Makefile
Normal file
|
@ -0,0 +1,180 @@
|
||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
|
||||||
|
|
||||||
|
# Default target executed when no arguments are given to make.
|
||||||
|
default_target: all
|
||||||
|
|
||||||
|
.PHONY : default_target
|
||||||
|
|
||||||
|
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
||||||
|
.NOTPARALLEL:
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Special targets provided by cmake.
|
||||||
|
|
||||||
|
# Disable implicit rules so canonical targets will work.
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
|
|
||||||
|
# Remove some rules from gmake that .SUFFIXES does not remove.
|
||||||
|
SUFFIXES =
|
||||||
|
|
||||||
|
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||||
|
|
||||||
|
|
||||||
|
# Suppress display of executed commands.
|
||||||
|
$(VERBOSE).SILENT:
|
||||||
|
|
||||||
|
|
||||||
|
# A target that is always out of date.
|
||||||
|
cmake_force:
|
||||||
|
|
||||||
|
.PHONY : cmake_force
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Set environment variables for the build.
|
||||||
|
|
||||||
|
# The shell in which to execute make rules.
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
# The CMake executable.
|
||||||
|
CMAKE_COMMAND = /usr/local/Cellar/cmake/3.6.2/bin/cmake
|
||||||
|
|
||||||
|
# The command to remove a file.
|
||||||
|
RM = /usr/local/Cellar/cmake/3.6.2/bin/cmake -E remove -f
|
||||||
|
|
||||||
|
# Escaping for special characters.
|
||||||
|
EQUALS = =
|
||||||
|
|
||||||
|
# The top-level source directory on which CMake was run.
|
||||||
|
CMAKE_SOURCE_DIR = /Users/amuralid/dev_test/cpp-jwt
|
||||||
|
|
||||||
|
# The top-level build directory on which CMake was run.
|
||||||
|
CMAKE_BINARY_DIR = /Users/amuralid/dev_test/cpp-jwt
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Targets provided globally by CMake.
|
||||||
|
|
||||||
|
# Special rule for the target edit_cache
|
||||||
|
edit_cache:
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
|
||||||
|
/usr/local/Cellar/cmake/3.6.2/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||||
|
.PHONY : edit_cache
|
||||||
|
|
||||||
|
# Special rule for the target edit_cache
|
||||||
|
edit_cache/fast: edit_cache
|
||||||
|
|
||||||
|
.PHONY : edit_cache/fast
|
||||||
|
|
||||||
|
# Special rule for the target rebuild_cache
|
||||||
|
rebuild_cache:
|
||||||
|
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||||
|
/usr/local/Cellar/cmake/3.6.2/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||||
|
.PHONY : rebuild_cache
|
||||||
|
|
||||||
|
# Special rule for the target rebuild_cache
|
||||||
|
rebuild_cache/fast: rebuild_cache
|
||||||
|
|
||||||
|
.PHONY : rebuild_cache/fast
|
||||||
|
|
||||||
|
# The main all target
|
||||||
|
all: cmake_check_build_system
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(CMAKE_COMMAND) -E cmake_progress_start /Users/amuralid/dev_test/cpp-jwt/CMakeFiles /Users/amuralid/dev_test/cpp-jwt/examples/CMakeFiles/progress.marks
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f CMakeFiles/Makefile2 examples/all
|
||||||
|
$(CMAKE_COMMAND) -E cmake_progress_start /Users/amuralid/dev_test/cpp-jwt/CMakeFiles 0
|
||||||
|
.PHONY : all
|
||||||
|
|
||||||
|
# The main clean target
|
||||||
|
clean:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f CMakeFiles/Makefile2 examples/clean
|
||||||
|
.PHONY : clean
|
||||||
|
|
||||||
|
# The main clean target
|
||||||
|
clean/fast: clean
|
||||||
|
|
||||||
|
.PHONY : clean/fast
|
||||||
|
|
||||||
|
# Prepare targets for installation.
|
||||||
|
preinstall: all
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f CMakeFiles/Makefile2 examples/preinstall
|
||||||
|
.PHONY : preinstall
|
||||||
|
|
||||||
|
# Prepare targets for installation.
|
||||||
|
preinstall/fast:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f CMakeFiles/Makefile2 examples/preinstall
|
||||||
|
.PHONY : preinstall/fast
|
||||||
|
|
||||||
|
# clear depends
|
||||||
|
depend:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
||||||
|
.PHONY : depend
|
||||||
|
|
||||||
|
# Convenience name for target.
|
||||||
|
examples/CMakeFiles/simple_ex1.dir/rule:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f CMakeFiles/Makefile2 examples/CMakeFiles/simple_ex1.dir/rule
|
||||||
|
.PHONY : examples/CMakeFiles/simple_ex1.dir/rule
|
||||||
|
|
||||||
|
# Convenience name for target.
|
||||||
|
simple_ex1: examples/CMakeFiles/simple_ex1.dir/rule
|
||||||
|
|
||||||
|
.PHONY : simple_ex1
|
||||||
|
|
||||||
|
# fast build rule for target.
|
||||||
|
simple_ex1/fast:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f examples/CMakeFiles/simple_ex1.dir/build.make examples/CMakeFiles/simple_ex1.dir/build
|
||||||
|
.PHONY : simple_ex1/fast
|
||||||
|
|
||||||
|
simple_ex1.o: simple_ex1.cc.o
|
||||||
|
|
||||||
|
.PHONY : simple_ex1.o
|
||||||
|
|
||||||
|
# target to build an object file
|
||||||
|
simple_ex1.cc.o:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f examples/CMakeFiles/simple_ex1.dir/build.make examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.o
|
||||||
|
.PHONY : simple_ex1.cc.o
|
||||||
|
|
||||||
|
simple_ex1.i: simple_ex1.cc.i
|
||||||
|
|
||||||
|
.PHONY : simple_ex1.i
|
||||||
|
|
||||||
|
# target to preprocess a source file
|
||||||
|
simple_ex1.cc.i:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f examples/CMakeFiles/simple_ex1.dir/build.make examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.i
|
||||||
|
.PHONY : simple_ex1.cc.i
|
||||||
|
|
||||||
|
simple_ex1.s: simple_ex1.cc.s
|
||||||
|
|
||||||
|
.PHONY : simple_ex1.s
|
||||||
|
|
||||||
|
# target to generate assembly for a file
|
||||||
|
simple_ex1.cc.s:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(MAKE) -f examples/CMakeFiles/simple_ex1.dir/build.make examples/CMakeFiles/simple_ex1.dir/simple_ex1.cc.s
|
||||||
|
.PHONY : simple_ex1.cc.s
|
||||||
|
|
||||||
|
# Help Target
|
||||||
|
help:
|
||||||
|
@echo "The following are some of the valid targets for this Makefile:"
|
||||||
|
@echo "... all (the default if no target is provided)"
|
||||||
|
@echo "... clean"
|
||||||
|
@echo "... depend"
|
||||||
|
@echo "... edit_cache"
|
||||||
|
@echo "... rebuild_cache"
|
||||||
|
@echo "... simple_ex1"
|
||||||
|
@echo "... simple_ex1.o"
|
||||||
|
@echo "... simple_ex1.i"
|
||||||
|
@echo "... simple_ex1.s"
|
||||||
|
.PHONY : help
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Special targets to cleanup operation of make.
|
||||||
|
|
||||||
|
# Special rule to run CMake to check the build system integrity.
|
||||||
|
# No rule that depends on this can have commands that come from listfiles
|
||||||
|
# because they might be regenerated.
|
||||||
|
cmake_check_build_system:
|
||||||
|
cd /Users/amuralid/dev_test/cpp-jwt && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
||||||
|
.PHONY : cmake_check_build_system
|
||||||
|
|
29
examples/cmake_install.cmake
Normal file
29
examples/cmake_install.cmake
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# Install script for directory: /Users/amuralid/dev_test/cpp-jwt/examples
|
||||||
|
|
||||||
|
# Set the install prefix
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||||
|
endif()
|
||||||
|
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
|
# Set the install configuration name.
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||||
|
if(BUILD_TYPE)
|
||||||
|
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||||
|
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_CONFIG_NAME "")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set the component getting installed.
|
||||||
|
if(NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
if(COMPONENT)
|
||||||
|
message(STATUS "Install component: \"${COMPONENT}\"")
|
||||||
|
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_COMPONENT)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
BIN
examples/simple_ex1
Executable file
BIN
examples/simple_ex1
Executable file
Binary file not shown.
21
examples/simple_ex1.cc
Normal file
21
examples/simple_ex1.cc
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include "jwt/jwt.hpp"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
using namespace jwt::params;
|
||||||
|
|
||||||
|
auto key = "secret"; //Secret to use for the algorithm
|
||||||
|
//Create JWT object
|
||||||
|
jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), secret(key)};
|
||||||
|
|
||||||
|
//Get the encoded string/assertion
|
||||||
|
auto enc_str = obj.signature();
|
||||||
|
std::cout << enc_str << std::endl;
|
||||||
|
|
||||||
|
//Decode
|
||||||
|
auto dec_obj = jwt::decode(enc_str, algorithms({"HS256"}), secret(key));
|
||||||
|
std::cout << dec_obj.header() << std::endl;
|
||||||
|
std::cout << dec_obj.payload() << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -67,18 +67,17 @@ void jwt_header::decode(const jwt::string_view enc_str, std::error_code& ec)
|
||||||
{
|
{
|
||||||
ec.clear();
|
ec.clear();
|
||||||
std::string json_str = base64_decode(enc_str);
|
std::string json_str = base64_decode(enc_str);
|
||||||
json_t obj;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
obj = json_t::parse(std::move(json_str));
|
payload_ = json_t::parse(std::move(json_str));
|
||||||
} catch(const std::exception& e) {
|
} catch(const std::exception& e) {
|
||||||
ec = DecodeErrc::JsonParseError;
|
ec = DecodeErrc::JsonParseError;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Look for the algorithm field
|
//Look for the algorithm field
|
||||||
auto alg_itr = obj.find("alg");
|
auto alg_itr = payload_.find("alg");
|
||||||
if (alg_itr == obj.end()) {
|
if (alg_itr == payload_.end()) {
|
||||||
ec = DecodeErrc::AlgHeaderMiss;
|
ec = DecodeErrc::AlgHeaderMiss;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -87,13 +86,14 @@ void jwt_header::decode(const jwt::string_view enc_str, std::error_code& ec)
|
||||||
|
|
||||||
if (alg_ != algorithm::NONE)
|
if (alg_ != algorithm::NONE)
|
||||||
{
|
{
|
||||||
auto itr = obj.find("typ");
|
auto itr = payload_.find("typ");
|
||||||
if (itr == obj.end()) {
|
if (itr == payload_.end()) {
|
||||||
ec = DecodeErrc::TypHeaderMiss;
|
ec = DecodeErrc::TypHeaderMiss;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& typ = itr.value().get<std::string>();
|
const auto& typ = itr.value().get<std::string>();
|
||||||
|
|
||||||
if (strcasecmp(typ.c_str(), "JWT")) {
|
if (strcasecmp(typ.c_str(), "JWT")) {
|
||||||
ec = DecodeErrc::TypMismatch;
|
ec = DecodeErrc::TypMismatch;
|
||||||
return;
|
return;
|
||||||
|
@ -104,6 +104,15 @@ void jwt_header::decode(const jwt::string_view enc_str, std::error_code& ec)
|
||||||
//TODO:
|
//TODO:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Populate header
|
||||||
|
for (auto it = payload_.begin(); it != payload_.end(); ++it) {
|
||||||
|
auto ret = headers_.insert(it.key());
|
||||||
|
if (!ret.second) {
|
||||||
|
ec = DecodeErrc::DuplClaims;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -282,6 +282,14 @@ TEST (EncodeTest, HeaderParamTest)
|
||||||
EXPECT_TRUE (ret);
|
EXPECT_TRUE (ret);
|
||||||
|
|
||||||
std::cout << obj.header() << std::endl;
|
std::cout << obj.header() << std::endl;
|
||||||
|
|
||||||
|
std::error_code ec;
|
||||||
|
auto enc_str = obj.signature();
|
||||||
|
|
||||||
|
auto dec_obj = jwt::decode(enc_str, algorithms({"none"}), ec, verify(false));
|
||||||
|
EXPECT_EQ (ec.value(), static_cast<int>(jwt::AlgorithmErrc::NoneAlgorithmUsed));
|
||||||
|
|
||||||
|
std::cout << dec_obj.header() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue