JWT header impl

This commit is contained in:
Arun M 2017-11-01 17:04:09 +05:30
parent 063a0af131
commit 3e867d77f1
13 changed files with 358 additions and 20 deletions

View 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;
}