Put verify under different function. Added new error codes for verification failures.

This commit is contained in:
Arun M 2017-12-16 16:39:52 +05:30
parent 912e4b5ff9
commit 7a511c46fe
7 changed files with 204 additions and 30 deletions

View file

@ -79,14 +79,16 @@ MIGkAgEBBDBeLCgapjZmvTatMHaYX3A02+0Ys3Tr8kda+E9DFnmCSiCOEig519fT
;
std::cout << "pem sign " << obj.signature() << std::endl;
std::cout << "Get claim value for exp: " << obj.payload().get_claim_value("exp") << std::endl;
std::cout << "Get claim value for exp: " <<
obj.payload().get_claim_value<uint64_t>("exp") << std::endl;
sleep(4);
auto dec_obj = jwt::decode(obj.signature(), pub_key, algorithms({"es256"}));
std::cout << dec_obj.payload() << std::endl;
}
int main() {
//basic_jwt_object_test();
jwt_object_pem_test();
basic_jwt_object_test();
//jwt_object_pem_test();
return 0;
}