Skip to content

Commit

Permalink
fix: Modified session key with url decoder (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoGiuliani authored Feb 12, 2024
1 parent e833ec0 commit 13ba4b3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public String encryptSessionKeyForIdpay(PublicKeyIDPay publicKeyIDPay, String se
Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
cipher.init(Cipher.ENCRYPT_MODE, rsaPublicKey);

byte[] sessionKeyBytes = Base64.getDecoder().decode(sessionKey);
byte[] sessionKeyBytes = Base64.getUrlDecoder().decode(sessionKey);
byte[] encryptedSessionKeyBytes = cipher.doFinal(sessionKeyBytes);

// encryptedSessionKeyBytes contains encrypted session key
Expand Down

0 comments on commit 13ba4b3

Please sign in to comment.