Package sun.misc

Examples of sun.misc.BASE64Encoder


        return new BASE64Decoder().decodeBuffer(id);
    }
   
    protected String storeSerializedState(HttpServletRequest request, byte[] state)
    {
        return new BASE64Encoder().encodeBuffer(state);
    }
View Full Code Here


     * @return token.
     */
    public static String createBasicAuthToken(String user, String password)
    {
        String token = user + ":" + password;
        String base64Token = new BASE64Encoder().encode(token.getBytes());

        return "Basic " + base64Token;
    }
View Full Code Here

    cipher.init(Cipher.ENCRYPT_MODE, key);

    byte[] inputBytes = toEncrypt.getBytes("UTF8");
    byte[] outputBytes = cipher.doFinal(inputBytes);

    BASE64Encoder encoder = new BASE64Encoder();
    String base64 = encoder.encode(outputBytes);

    return base64;
  }
View Full Code Here

      SecretKey key = keyFactory.generateSecret(keySpec);
      cipher.init(Cipher.ENCRYPT_MODE, key);
      byte[] cleartext = unencryptedString.getBytes(UNICODE_FORMAT);
      byte[] ciphertext = cipher.doFinal(cleartext);

      BASE64Encoder base64encoder = new BASE64Encoder();
      return base64encoder.encode(ciphertext);
    } catch (Exception e) {
      throw new EncryptionException(e);
    }
  }
View Full Code Here

    cipher.init(Cipher.ENCRYPT_MODE, key);

    byte[] inputBytes = toEncrypt.getBytes("UTF8");
    byte[] outputBytes = cipher.doFinal(inputBytes);

    BASE64Encoder encoder = new BASE64Encoder();
    String base64 = encoder.encode(outputBytes);

    return base64;
  }
View Full Code Here

    cipher.init(Cipher.ENCRYPT_MODE, key);

    byte[] inputBytes = toEncrypt.getBytes("UTF8");
    byte[] outputBytes = cipher.doFinal(inputBytes);

    BASE64Encoder encoder = new BASE64Encoder();
    String base64 = encoder.encode(outputBytes);

    return base64;
  }
View Full Code Here

      SecretKey key = keyFactory.generateSecret(keySpec);
      cipher.init(Cipher.ENCRYPT_MODE, key);
      byte[] cleartext = unencryptedString.getBytes(UNICODE_FORMAT);
      byte[] ciphertext = cipher.doFinal(cleartext);

      BASE64Encoder base64encoder = new BASE64Encoder();
      return base64encoder.encode(ciphertext);
    } catch (Exception e) {
      throw new EncryptionException(e);
    }
  }
View Full Code Here

      UnsupportedEncodingException {

    cipher.init( Cipher.ENCRYPT_MODE, secretKey );

    byte[] cipherText = cipher.doFinal( value.getBytes( "UTF-8" ) );
    BASE64Encoder encoder = new BASE64Encoder();

    return encoder.encode( cipherText );
  }
View Full Code Here

         }
      }
      logger.debug("identifier produced : " + identif);
    }
   
    BASE64Encoder encoder = new BASE64Encoder();
   
    String ecodedIdentif = "";
    int index = 0;
    while(index<identif.length()){
      String tmpStr = "";
      try{
        tmpStr = identif.substring(index, index + 10);
      } catch (Exception e) {
        tmpStr = identif.substring(index, identif.length());
      }
      String tmpEncoded = encoder.encode(tmpStr.getBytes());
      ecodedIdentif = ecodedIdentif + tmpEncoded;
      index = index + 10;
    }

    logger.debug("end method execution, returning encoded identifier: " + ecodedIdentif);
View Full Code Here

       if(iterBiobjPars.hasNext()){
         identif = identif + "&";
       }
    }
    logger.debug("identifier produced : " + identif);
    BASE64Encoder encoder = new BASE64Encoder();
   
    String ecodedIdentif = "";
    int index = 0;
    while(index<identif.length()){
      String tmpStr = "";
      try{
        tmpStr = identif.substring(index, index + 10);
      } catch (Exception e) {
        tmpStr = identif.substring(index, identif.length());
      }
      String tmpEncoded = encoder.encode(tmpStr.getBytes());
      ecodedIdentif = ecodedIdentif + tmpEncoded;
      index = index + 10;
    }

    logger.debug("end method execution, returning encoded identifier: " + ecodedIdentif);
View Full Code Here

TOP

Related Classes of sun.misc.BASE64Encoder

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.