Package sun.misc

Examples of sun.misc.BASE64Decoder


    in.close();

    Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
    cipher.init(Cipher.DECRYPT_MODE, key);

    BASE64Decoder decoder = new BASE64Decoder();

    byte[] inputBytes = decoder.decodeBuffer(toDecrypt);
    byte[] outputBytes = cipher.doFinal(inputBytes);

    String result = new String(outputBytes, "UTF8");
    return result;
  }
View Full Code Here


    in.close();

    Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
    cipher.init(Cipher.DECRYPT_MODE, key);

    BASE64Decoder decoder = new BASE64Decoder();

    byte[] inputBytes = decoder.decodeBuffer(toDecrypt);
    byte[] outputBytes = cipher.doFinal(inputBytes);

    String result = new String(outputBytes, "UTF8");
    return result;
  }
View Full Code Here

          "encrypted string was null or empty");

    try {
      SecretKey key = keyFactory.generateSecret(keySpec);
      cipher.init(Cipher.DECRYPT_MODE, key);
      BASE64Decoder base64decoder = new BASE64Decoder();
      byte[] cleartext = base64decoder.decodeBuffer(encryptedString);
      byte[] ciphertext = cipher.doFinal(cleartext);

      return bytes2String(ciphertext);
    } catch (Exception e) {
      throw new EncryptionException(e);
View Full Code Here

  public String decrypt( String value ) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException,
      IOException {

    cipher.init( Cipher.DECRYPT_MODE, secretKey );

    BASE64Decoder dec = new BASE64Decoder();
    byte[] decipherText = cipher.doFinal( dec.decodeBuffer( value ) );

    return new String( decipherText );
  }
View Full Code Here

    log.debug("Key  == " + key + " -- " + key.length());
    log.debug("User == " + user + " -- " + user.length());
    log.debug("Pass == " + pass_enc_base64 + " -- " + pass_enc_base64.length());
    log.debug("View == " + viewid + " -- " + viewid.length());
   
    byte[] pass_enc = new BASE64Decoder().decodeBuffer(pass_enc_base64);

    MessageDigest md = MessageDigest.getInstance("MD5");
    md.update((user + viewid).getBytes("UTF-8"));
    byte[] iv = md.digest();   
View Full Code Here

    Content templateContent = contentProxy.readTemplate(documentId,new HashMap());
   
    InputStream is = null;
    byte[] byteContent = null;
    try {
      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      byteContent = bASE64Decoder.decodeBuffer(templateContent.getContent());
      is = new java.io.ByteArrayInputStream(byteContent);
    }catch (Throwable t){
      logger.warn("Error on decompile",t);
    }finally{
      try {
View Full Code Here

    logger.debug("Read the template=" + template.getFileName());
   
    InputStream is = null;
    byte[] templateContent = null;
    try {
      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      templateContent = bASE64Decoder.decodeBuffer(template.getContent());
      is = new java.io.ByteArrayInputStream(templateContent);
    }catch (Throwable t){
      logger.warn("Error on decompile",t);
    }
   
View Full Code Here

        logger.error("The document haven't the template.documentId="+documentId+" userUniqueIdentifier="+userUniqueIdentifier);       
        return;
      }
      logger.debug("Read the template."+template.getFileName());
      InputStream is = null;   
      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      byte[] templateContent = bASE64Decoder.decodeBuffer(template.getContent());
      is = new java.io.ByteArrayInputStream(templateContent);

      if (template.getFileName().indexOf(".zip") > -1) {
        flgTemplateStandard = "false";
      }
View Full Code Here

          requestParameters.put("SBI_READ_ONLY_TEMPLATE", "true");
          Content template=contentProxy.readTemplate(subreportMeta.getDocumentId(), requestParameters);
          template.getFileName();
          logger.debug("Read the template.(subreport)"+template.getFileName());
          InputStream is = null;   
          BASE64Decoder bASE64Decoder = new BASE64Decoder();
          byte[] templateContent = bASE64Decoder.decodeBuffer(template.getContent());
          is = new java.io.ByteArrayInputStream(templateContent);
          String str = new String(templateContent);
   
          SpagoBIAccessUtils util = new SpagoBIAccessUtils();
   
View Full Code Here

   * @return byte array decoded
   */
  public byte[] decodeBase64(String encoded) {
    byte[] clear = null;
    try{
      BASE64Decoder decoder = new BASE64Decoder();
      clear = decoder.decodeBuffer(encoded);
      return clear;
    } catch (IOException ioe) {
      logger.error("Engines"+ this.getClass().getName()+ "getPublicKey:"+
               "Error during base64 decoding", ioe);
    }
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.