Skip to content

Commit

Permalink
fix name and disable 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc committed Aug 31, 2024
1 parent 2aaad76 commit 361c3a5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/TokenTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,8 @@ TEST(TokenTest, CreateTokenRS256) {
token);
}

TEST(TokenTest, CreateTokenRS512) {
auto token = jwt::create().set_issuer("auth0").set_type("JWS").sign(
jwt::algorithm::rs512(rsa512_pub_key, rsa512_priv_key, "", ""));

ASSERT_EQ("eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.GZhnjtsvBl2_KDSxg4JW6xnmNjr2mWhYSZSSQyLKvI0"
"TK86sJKchkt_HDy2IC5l5BGRhq_Xv9pHdA1umidQZG3a7gWvHsujqybCBgBraMTd1wJrCl4QxFg2RYHhHbRqb9BnPJgFD_vryd4GB"
"hfGgejPBCBlGrQtqFGFdHHOjNHY",
token);
}

TEST(TokenTest, CreateTokenRS512Encrypted) {
#if !defined(JWT_OPENSSL_1_0_0)
TEST(TokenTest, CreateTokenRS256Encrypted) {
// openssl genrsa -aes256 -out private.pem 2048
// openssl rsa -in private.pem -pubout -out public.pem
const std::string rsa_passphrase = "helloworld";
Expand Down Expand Up @@ -135,6 +126,17 @@ ixip+DkPtcbSsFjn2bVnknYYluk+Qupw/kWGxyFbvC1sYhn1iNwFv0g=
"SXxKTDSHVlg8irtG9ZQZXcuhaZCieAE1uIlJmKpEg4MUHVfvMsgy0N0p64NOiHa6bQsEb3NFn7UAe55jKQ",
token);
}
#endif

TEST(TokenTest, CreateTokenRS512) {
auto token = jwt::create().set_issuer("auth0").set_type("JWS").sign(
jwt::algorithm::rs512(rsa512_pub_key, rsa512_priv_key, "", ""));

ASSERT_EQ("eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.GZhnjtsvBl2_KDSxg4JW6xnmNjr2mWhYSZSSQyLKvI0"
"TK86sJKchkt_HDy2IC5l5BGRhq_Xv9pHdA1umidQZG3a7gWvHsujqybCBgBraMTd1wJrCl4QxFg2RYHhHbRqb9BnPJgFD_vryd4GB"
"hfGgejPBCBlGrQtqFGFdHHOjNHY",
token);
}

TEST(TokenTest, CreateTokenPS256) {
auto token = jwt::create().set_issuer("auth0").set_type("JWS").sign(
Expand Down

0 comments on commit 361c3a5

Please sign in to comment.