File: test_hmac.cc

package info (click to toggle)
cpp-jwt 1.5%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 508 kB
  • sloc: cpp: 3,374; ansic: 33; sh: 31; makefile: 12
file content (16 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include "jwt/algorithm.hpp"

void basic_hmac_test()
{
  jwt::string_view sv = "secret" ;
  jwt::string_view d = "Some random data string";
  auto res = jwt::HMACSign<jwt::algo::HS256>::sign(sv, d);

  std::cout << res.first << std::endl;
}

int main() {
  basic_hmac_test();
  return 0;
}