#ifndef UTIL_JWT_INCLUDED
#define UTIL_JWT_INCLUDED

#include "utils/ijwt.h"
#include "../common/common.h"
#include "wrapper/utils/errors.h"
#include "wrapper/utils/tools.h"

class Jwt : IJwt
{
private:
  Handle<std::string> getHash(char *payload);
  Tools tools;

public:
  Jwt(){};
  ~Jwt(){};

  Handle<std::string> createHeader(std::string alg);
  Handle<std::string> createPayload(std::string aud, std::string sub,
      int core, long nbf, std::string iss, long exp, long iat, std::string jti, std::string desc);
  Handle<std::string> createJWTToken(std::string header, std::string payload, std::string privateKey);
  Handle<std::string> verifyJWTToken(std::string jwtToken, std::string publicKey);
  bool licenseValidateFormat(std::string jwtToken);
};

#endif //! UTIL_JWT_INCLUDED
