Package org.apache.commons.codec.binary

Examples of org.apache.commons.codec.binary.Base64.decodeBase64()


     * @return String
     * @throws IOException
     */
    public static String decodeString(String str) throws IOException {
        Base64 base64 = new Base64();
        String value = new String(base64.decodeBase64(str.getBytes()));       
        return (value);
    }
   
    /**
     * Strips HTML and truncates.
View Full Code Here


     * @return String
     * @throws IOException
     */
    public static String decodeString(String str) throws IOException {
        Base64 base64 = new Base64();
        String value = new String(base64.decodeBase64(str.getBytes()));       
        return (value);
    }
   
    /**
     * Strips HTML and truncates.
View Full Code Here

     * @return String
     * @throws IOException
     */
    public static String decodeString(String str) throws IOException {
        Base64 base64 = new Base64();
        String value = new String(base64.decodeBase64(str.getBytes()));       
        return (value);
    }
              
    /**
     * @param str
View Full Code Here

    SecretKeySpec spec;
    String signed;

    b64 = new Base64();
    mac = Mac.getInstance("HmacSHA512");
    spec = new SecretKeySpec(b64.decodeBase64(this.apiSecret.getBytes()), "HmacSHA512");
    mac.init(spec);

    return new String(b64.encodeBase64(mac.doFinal(data.getBytes())), "UTF-8");
  }
View Full Code Here

        return base64.encodeBase64URLSafeString(bb.array());
    }

    public String uuidFromBase64(String str) {
        Base64 base64 = new Base64();
        byte[] bytes = base64.decodeBase64(str);
        ByteBuffer bb = ByteBuffer.wrap(bytes);
        UUID uuid = new UUID(bb.getLong(), bb.getLong());
        return uuid.toString();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.