Error: Bad Base64Coder input character

Posted by sebby_zml on Stack Overflow See other posts from Stack Overflow or by sebby_zml
Published on 2010-03-29T02:48:30Z Indexed on 2010/03/29 2:53 UTC
Read the original article Hit count: 497

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about base64

Related posts about java