import org.apache.commons.codec.binary.Base64; 

 

String Base64.encodeBase64URLSafeString(byte[])

byte[] Base64.decodeBase64(String)