code: public static byte[] decode(String s) {
  
          if( s == null ){
              throw new IllegalArgumentException("Input string was null.");
          }
  
          byte[] inBytes;
          try {
              inBytes = s.getBytes("US-ASCII");
          }
          catch( java.io.UnsupportedEncodingException uee ) {
              inBytes = s.getBytes();
          }
  
          if( inBytes.length == 0 ) {
              return new byte[0];
          } else if( inBytes.length < 4 ){
              throw new IllegalArgumentException(
                      "Base64-encoded string must have at least four characters, but length specified was " + inBytes.length);
          }   // end if
  
          return decodeBytes(inBytes);
      }
docs: Base64 encoding methods of Authentication
  Taken from http://iharder.sourceforge.net/current/java/base64/ (public domain)
  and adapted for our needs here.