mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 09:18:33 +00:00
JWT header impl
This commit is contained in:
parent
063a0af131
commit
3e867d77f1
13 changed files with 358 additions and 20 deletions
19
include/jwt/test/test_jwt_header.cc
Normal file
19
include/jwt/test/test_jwt_header.cc
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <iostream>
|
||||
#include "jwt/jwt.hpp"
|
||||
|
||||
void test_basic_header()
|
||||
{
|
||||
jwt::jwt_header hdr;
|
||||
hdr = jwt::jwt_header{jwt::algorithm::HS256};
|
||||
std::string jstr = to_json_str(hdr);
|
||||
std::cout << jstr << std::endl;
|
||||
|
||||
std::string enc_str = hdr.base64_encode();
|
||||
std::cout << "Base64: " << enc_str << std::endl;
|
||||
std::cout << "Decoded: " << jwt::jwt_header::base64_decode(enc_str) << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
test_basic_header();
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue