Package sun.misc

Examples of sun.misc.BASE64Decoder.decodeBuffer()


        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


        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

    @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

    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

        }

        private void decryprtString(JTextArea textArea1, JTextArea textArea2,
                File keyFile, Encrypter encrypter) throws Exception {
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] clearText = decoder.decodeBuffer(textArea1.getText());
            byte[] resultText = encrypter.decrypt(clearText, keyFile);
            textArea2.setText(new String(resultText, Encrypter.ENCODING));

        }
    }
View Full Code Here

        try {
            String text = new String(cipherByte);
            String saltString = text.substring(0, 12);
            String cipherText = text.substring(12, text.length());
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] saltArray = decoder.decodeBuffer(saltString);
            byte[] cipherTextArray = decoder.decodeBuffer(cipherText);
            char[] passwordChar = password.toCharArray();

            // Create the PBEKeySpec with the given password
            PBEKeySpec keySpec = new PBEKeySpec(passwordChar);
View Full Code Here

            String text = new String(cipherByte);
            String saltString = text.substring(0, 12);
            String cipherText = text.substring(12, text.length());
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] saltArray = decoder.decodeBuffer(saltString);
            byte[] cipherTextArray = decoder.decodeBuffer(cipherText);
            char[] passwordChar = password.toCharArray();

            // Create the PBEKeySpec with the given password
            PBEKeySpec keySpec = new PBEKeySpec(passwordChar);
View Full Code Here

            byte[] cipherByte = readByte(new File(inputFile));
            String text = new String(cipherByte);
            String saltString = text.substring(0, 12);
            String cipherText = text.substring(12, text.length());
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] saltArray = decoder.decodeBuffer(saltString);
            byte[] cipherTextArray = decoder.decodeBuffer(cipherText);
            char[] passwordChar = password.toCharArray();

            // Create the PBEKeySpec with the given password
            PBEKeySpec keySpec = new PBEKeySpec(passwordChar);
View Full Code Here

            String text = new String(cipherByte);
            String saltString = text.substring(0, 12);
            String cipherText = text.substring(12, text.length());
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] saltArray = decoder.decodeBuffer(saltString);
            byte[] cipherTextArray = decoder.decodeBuffer(cipherText);
            char[] passwordChar = password.toCharArray();

            // Create the PBEKeySpec with the given password
            PBEKeySpec keySpec = new PBEKeySpec(passwordChar);
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.