mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 09:18:33 +00:00
Put verify under different function. Added new error codes for verification failures.
This commit is contained in:
parent
912e4b5ff9
commit
7a511c46fe
7 changed files with 204 additions and 30 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue