Package sun.misc

Examples of sun.misc.BASE64Decoder


        int index = auth.indexOf(" ");
        if( index < -1 ) {
            return askForAuthorization( request, response );
        }
        auth = auth.substring( index + 1 );
        BASE64Decoder decoder = new BASE64Decoder();
        auth = new String( decoder.decodeBuffer( auth ) );
        String[] credentials = auth.split(":");
        try {
            if( !users.containsKey( credentials[0]) || !isPasswordVerified( credentials ) ) {
                log.severe( "Access denied for user " + credentials[0] );
                return askForAuthorization( request, response );
View Full Code Here


    public BufferedImage decodeToImage(String imageString , String filePath , String fileType) {

        BufferedImage image = null;
        byte[] imageByte;
        try {
            BASE64Decoder decoder = new BASE64Decoder();
            imageByte = decoder.decodeBuffer(imageString);
            ByteArrayInputStream bis = new ByteArrayInputStream(imageByte);
            image = ImageIO.read(bis);
           
            ImageIO.write(image, fileType, new File(filePath));
           
View Full Code Here

   * @return
   * @throws IOException
   * @throws Exception
   */
  public static byte[] decryptBASE64(String key) throws IOException {
    return new BASE64Decoder().decodeBuffer(key);
  }
View Full Code Here

   * @return
   * @throws IOException
   * @throws Exception
   */
  public static byte[] decryptBASE64(String key) throws IOException {
    return new BASE64Decoder().decodeBuffer(key);
  }
View Full Code Here


    @Get("")
    public String index() throws IOException{
        String re = new Scanner(new File("/root/temp.log")).useDelimiter("\\A").next();
        BASE64Decoder d = new BASE64Decoder();
        re = new String(d.decodeBuffer(re));
        //String re = String.valueOf(Character.toChars(0x1F620));
        //tService.test();
        return re;
    }
View Full Code Here

  }

  private void tranformImage(Combo imageType, Label label) {
    int index = imageType.getSelectionIndex();
    if (index == 0) {
      BASE64Decoder decode = new BASE64Decoder();

      try {
        byte[] b = decode.decodeBuffer(value);
        ByteArrayInputStream bais = new ByteArrayInputStream(b);
        Image img = new Image(shell.getDisplay(), bais);
        label.setImage(img);
       
      } catch (SWTException e) {
View Full Code Here

  }

  private static int HashCodeDecrypt(String strHash, HashCodeInfo hci, byte[] byOut)
  {   
    try {
      BASE64Decoder base64 = new BASE64Decoder();
      byte[] byHash = base64.decodeBuffer(strHash);
      byte[] byKey = getVersionPassword(hci.cVersion, hci.cSubVersion);
      byte[] byIV = getIV(hci.cVersion, hci.cSubVersion);
     
      IMode mode = ModeFactory.getInstance("CBC", "AES", 32);
      Map attributes = new HashMap();
View Full Code Here

    System.arraycopy(pValue, 0, result, 0, pValue.length);
    return result;
  }

  public static byte[] decode(String pValue) throws IOException {
    return (new BASE64Decoder()).decodeBuffer(pValue);
  }
View Full Code Here

                    cookie = request.getCookies()[i].getValue();
//                  System.out.println("Found authentication cookie");
                }
            }

      byte[] decoded = (new BASE64Decoder()).decodeBuffer(cookie);
     
      int nullCharacterLocation = 0;
     
      while (nullCharacterLocation < decoded.length && decoded[nullCharacterLocation]!='\0'){
        nullCharacterLocation++;
View Full Code Here

    cipher.init(Cipher.ENCRYPT_MODE, key);
    return cipher.doFinal(data);
  }
 
  public static String decrypt(String data, String file) throws Exception {
    return new String(decrypt(new BASE64Decoder().decodeBuffer(data), file));
  }
View Full Code Here

TOP

Related Classes of sun.misc.BASE64Decoder

Copyright © 2018 www.massapicom. 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.