In C#, I can pass a string to Convert.FromBase64String(String string), which returns a byte[]. Take, for example, the following code:
string key = "lRixPxNRmNOTxB2npoa5zCZR2I/GkuCndWtcRS/w4CI=";
byte[] KeyBytes = Convert.FromBase64String(key);
Console.WriteLine(KeyBytes.Length); //output 32
If I try the same thing in java using the java.util.Base64 library,
it looks something like this:
String key = "lRixPxNRmNOTxB2npoa5zCZR2I/GkuCndWtcRS/w4CI=";
byte[] base64KeyBytes = Base64.getEncoder().encode(key.getBytes(UTF_8));
System.out.println(base64KeyBytes.length); //output 60
The Java encode method requires a type byte[] for the argument, and I think this is what my problem stems from.
Is there anyway a way in Java to produce the same output that I'm getting in C#?