pineapple/externals/cpp-jwt/include/jwt/test/test_jwt_header.cc
2022-07-26 03:25:01 +02:00

19 lines
436 B
C++
Executable file

#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: " << hdr.base64_decode(enc_str) << std::endl;
}
int main() {
test_basic_header();
return 0;
}