Key key = keyStore.getKey(alias, password.toCharArray()); String encodedKey = new Base64Encoder().encode(key.getEncoded()); System.out.println("key ? " + encodedKey);
if(auth != null) auth = "Basic " + new Base64Encoder().encode(auth.getBytes("UTF-8"));
/** * Create ObjectId converter */ public ObjectIdConverter() { base64 = new Base64Encoder(); }
rec.position = 0; rec.compress(); var b64:Base64Encoder = new Base64Encoder(); b64.encodeBytes(rec); ExternalInterface.call('soundRecorded', b64.toString());
/** * Create ObjectId converter */ public ObjectIdConverter() { base64 = new Base64Encoder(); }
public static String byteArrayToBase64(byte[] b) { return new Base64Encoder().encode(b); }
/** * Initialize AES showing errors if failed */ private void initializeAES() { try { base64Encoder = new Base64Encoder(); random = SecureRandom.getInstanceStrong(); } catch (NoSuchAlgorithmException exc) { logger.error("Error initializing secure random", exc); } }
public static byte[] base64Decode(String data) { return new Base64Encoder().decode(data); }
public static byte[] base64ToByteArray(String s) { return new Base64Encoder().decode(s); } }
public static String base64Encode(byte[] data) { return new Base64Encoder().encode(data); }
public static String getImageHexaBase64(BufferedImage bufferedImage, String imageformat) { //System.out.println("@@@@@@@ IMAGE - getImageHexaBase64 NEW Way @@@@@@"); ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); //"gif" "png" "jpeg" try { ImageIO.write(bufferedImage, imageformat.toString() , baos); baos.flush(); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Erro generating Base64 for the image", e); } byte[] resultImageAsRawBytes = baos.toByteArray(); String encodedString = new Base64Encoder().encode(resultImageAsRawBytes); //String encodedString = Base64.encodeBytes(resultImageAsRawBytes); return encodedString; }
public static String getImageHexaBase64(BufferedImage bufferedImage, String imageformat) { //System.out.println("@@@@@@@ IMAGE - getImageHexaBase64 NEW Way @@@@@@"); ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); //"gif" "png" "jpeg" try { ImageIO.write(bufferedImage, imageformat.toString() , baos); baos.flush(); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Erro generating Base64 for the image", e); } byte[] resultImageAsRawBytes = baos.toByteArray(); String encodedString = new Base64Encoder().encode(resultImageAsRawBytes); //String encodedString = Base64.encodeBytes(resultImageAsRawBytes); return encodedString; }
public static String streamToBase64(InputStream inputStream) throws Exception { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); StreamUtil.io(inputStream, byteArrayOutputStream, true, false); return new Base64Encoder().encode(byteArrayOutputStream.toByteArray()); }
public static String[] makeHttpClientAutorizationHeader(String username, String password) { String un_pd = username + ":" + (password == null ? "" : password); byte[] bytes; try { bytes = un_pd.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new PaxmlRuntimeException(e); } String auth = "Basic " + new Base64Encoder().encode(bytes); return new String[] { "Authorization", auth }; } }
byte[] buffer = new Base64Encoder().decode(compressedData);
if(auth != null) auth = "Basic " + new Base64Encoder().encode(auth.getBytes("UTF-8"));
if(auth != null) auth = "Basic " + new Base64Encoder().encode(auth.getBytes("UTF-8"));
if(auth != null) auth = "Basic " + new Base64Encoder().encode(auth.getBytes("UTF-8"));
if(auth != null) auth = "Basic " + new Base64Encoder().encode(auth.getBytes("UTF-8"));
auth = "Basic " + new Base64Encoder().encode(auth.getBytes("UTF-8"));