Skip to content

Commit

Permalink
fix: bad base64 contain "\n" cannot be decoded
Browse files Browse the repository at this point in the history
  • Loading branch information
BeRealQueally committed Feb 13, 2024
1 parent 6a2283d commit 7a680ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/src/main/java/com/infineon/esim/util/Bytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ public static String encodeBase64String(byte[] input) {
* @return Byte array with decoded data
*/
public static byte[] decodeBase64String(String input) {
return Base64.getDecoder().decode(input);
String str = input.replace("\n","");
return Base64.getDecoder().decode(str);
}

public static String encodeString(byte[] input) {
Expand Down

0 comments on commit 7a680ba

Please sign in to comment.