Examples of BASE64Encoder


Examples of sun.misc.BASE64Encoder

      out.println("");
      out.flush();

      // invia il file codificato come uuencode
      FileInputStream fis = new FileInputStream(f);
      new BASE64Encoder().encodeBuffer(fis, os);
      fis.close();

      out.println("");
    }

    for(int i = 0; i < ssupList.size(); i++)
    {
      StreamSupplier ss = (StreamSupplier) (ssupList.get(i));

      out.println("--" + boundaryID);
      out.println("Content-Type: " + ss.getMimeType(i));
      out.println("Content-Transfer-Encoding: base64");
      if(ss.isMimeInLine(i))
        out.println("Content-Disposition: in-line; filename=\"" + ss.getNomeFile(i) + "\"");
      else
        out.println("Content-Disposition: attachment; filename=\"" + ss.getNomeFile(i) + "\"");
      out.println("");
      out.flush();

      InputStream istr = ss.getInput(i);
      new BASE64Encoder().encodeBuffer(istr, os);
      ss.notifyDone(istr, i);

      out.println("");
    }
View Full Code Here

Examples of sun.misc.BASE64Encoder

   */
  public static String encrypt(String str) {
    try {
      final Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION);
      cipher.init(Cipher.ENCRYPT_MODE, getKey());
      return new BASE64Encoder().encode(cipher.doFinal(str.getBytes(ENCODING)));
    }
    catch(final GeneralSecurityException gse) {
      throw new IllegalArgumentException("Encryption failed due to an unexpected security error: " + gse.getMessage(),
          gse);
    }
View Full Code Here

Examples of sun.misc.BASE64Encoder

            cipher.init(Cipher.ENCRYPT_MODE, theKey);
            // 注意把字符串转换成字节需要指定编码方式,一般用此“UTF8”。
            byte[] plaintext = strPwd.getBytes("UTF8");
            ciphertext = cipher.doFinal(plaintext);

            BASE64Encoder enc = new BASE64Encoder();
            cipherString = enc.encode(ciphertext);
        } catch (Exception e) {
            cipherString = strPwd;
            System.err.println("加密方法StrTool.getEncryptStr()异常(Key值存在问题):\n"
                    + e.getMessage());
        }
View Full Code Here

Examples of sun.misc.BASE64Encoder

    try {
      Cipher cipher = Cipher.getInstance("Desede/ECB/PKCS5Padding");
      cipher.init(Cipher.ENCRYPT_MODE, theKey);
      byte[] plaintext = strPwd.getBytes("UTF8");
      ciphertext = cipher.doFinal(plaintext);
      BASE64Encoder enc = new BASE64Encoder();
      cipherString = enc.encode(ciphertext);
    } catch (Exception e) {
      cipherString = strPwd;
      e.printStackTrace();
    }
View Full Code Here

Examples of sun.misc.BASE64Encoder

    try {
      Cipher cipher = Cipher.getInstance("Desede/ECB/PKCS5Padding");
      cipher.init(Cipher.ENCRYPT_MODE, theKey);
      byte[] plaintext = strPwd.getBytes("UTF8");
      ciphertext = cipher.doFinal(plaintext);
      BASE64Encoder enc = new BASE64Encoder();
      cipherString = enc.encode(ciphertext);
    } catch (Exception e) {
      cipherString = strPwd;
      e.printStackTrace();
    }
View Full Code Here

Examples of weblogic.utils.encoders.BASE64Encoder

   * @param plaintext text to hash
   * @return base64-encoded hashed text
   */
  static protected String hash(MessageDigest md, String plaintext)
  {
    BASE64Encoder enc = new BASE64Encoder();
     
    return enc.encodeBuffer(md.digest(plaintext.getBytes()));
  }
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.