Error: Bad Base64Coder input character
- by sebby_zml
Hi,
I am currently facing an error called "Bad Base64Coder input character at ..."
Here is my code in java.
String nonce2 = strNONCE;
byte[] nonceBytes1 = Base64Coder.decode(nonce2);
System.out.println("nonceByte1 value : " + nonceBytes1);
The problem now is i get Bad Base64Coder input character error and the nonceBytes1 value is printed as null.
I am trying to decode the nonce2 from Base64Coder. My strNONCE value is 16
byte[] nonce = new byte[16];
Random rand;
rand = SecureRandom.getInstance ("SHA1PRNG");
rand.nextBytes(nonce);
//convert byte array to string.
strNONCE = new String(nonce);
any help is deeply appreciated