Package sun.misc

Examples of sun.misc.BASE64Decoder.decodeBuffer()


        }
        // Get encoded user and password, comes after "BASIC "
        String userpassEncoded = authHeader.substring( 6 );

        BASE64Decoder dec = new BASE64Decoder();
        String userpassDecoded = new String( dec.decodeBuffer( userpassEncoded ) );
        int idx = userpassDecoded.indexOf( ':' );

        if ( idx == -1 )
        {
            return false;
View Full Code Here


    public static String decodeString(String encryptedPwd) {
        BASE64Decoder decoder = new BASE64Decoder() ;
       
        try {       
            byte[] passwordBytes =
                decoder.decodeBuffer(encryptedPwd);
            Cipher cipher = Cipher.getInstance("DES");
            cipher.init(Cipher.DECRYPT_MODE, key);
            passwordBytes = cipher.doFinal(passwordBytes);
            return new String (passwordBytes, "UTF8");
        }
View Full Code Here

        }
        // Get encoded user and password, comes after "BASIC "
        String userpassEncoded = authHeader.substring( 6 );

        BASE64Decoder dec = new BASE64Decoder();
        String userpassDecoded = new String( dec.decodeBuffer( userpassEncoded ) );
        int idx = userpassDecoded.indexOf( ':' );

        if ( idx == -1 )
        {
            return false;
View Full Code Here

        }
        // Get encoded user and password, comes after "BASIC "
        String userpassEncoded = authHeader.substring( 6 );

        BASE64Decoder dec = new BASE64Decoder();
        String userpassDecoded = new String( dec.decodeBuffer( userpassEncoded ) );
        int idx = userpassDecoded.indexOf( ':' );

        if ( idx == -1 )
        {
            return false;
View Full Code Here

        String output = "";
        try {
            Cipher cipher = Cipher.getInstance("Desede/ECB/PKCS5Padding");
            BASE64Decoder dec = new BASE64Decoder();
            byte[] ciphertext = dec.decodeBuffer(strPwdCode);
            // 解密过程。
            cipher.init(Cipher.DECRYPT_MODE, theKey);
            byte[] decryptedText = cipher.doFinal(ciphertext);
            output = new String(decryptedText, "UTF8");
        } catch (Exception e) {
View Full Code Here

    String output = "";
    try {
      Cipher cipher = Cipher.getInstance("Desede/ECB/PKCS5Padding");
      BASE64Decoder dec = new BASE64Decoder();
      byte[] ciphertext = dec.decodeBuffer(strPwdCode);

      cipher.init(Cipher.DECRYPT_MODE, theKey);
      byte[] decryptedText = cipher.doFinal(ciphertext);
      output = new String(decryptedText, "UTF8");
    } catch (Exception e) {
View Full Code Here

    this.url = savePath + "/" + this.fileName;
    BASE64Decoder decoder = new BASE64Decoder();
    try {
      File outFile = new File(this.getPhysicalPath(this.url));
      OutputStream ro = new FileOutputStream(outFile);
      byte[] b = decoder.decodeBuffer(base64Data);
      for (int i = 0; i < b.length; ++i) {
        if (b[i] < 0) {
          b[i] += 256;
        }
      }
View Full Code Here

       
        BASE64Decoder decoder = new BASE64Decoder();
        byte[] result = null;
     
        try {
            result = decoder.decodeBuffer(ssha);
        } catch (IOException e) {
            throw new IASSecurityException(e);
        }
        assert (result.length > 20);
       
View Full Code Here

      String mimeType = MimeUtils.getMimeType(templateFileName);
      logger.debug("Mime type is = " + mimeType);
      response.setContentType(mimeType);

      BASE64Decoder bASE64Decoder = new BASE64Decoder();
      byte[] templateContent = bASE64Decoder.decodeBuffer(template.getContent());
      response.setContentLength(templateContent.length);
      response.getOutputStream().write(templateContent);
      response.getOutputStream().flush()
      response.getOutputStream().close();
     
View Full Code Here

        Content templateContent = contentProxy.readTemplate(documentId,new HashMap());
 
        byte[] byteContent = null;
        try {
          BASE64Decoder bASE64Decoder = new BASE64Decoder();
          byteContent = bASE64Decoder.decodeBuffer(templateContent.getContent());
          String xmlSourceBean = new String(byteContent);
          SourceBean sb =SourceBean.fromXMLString(xmlSourceBean);
          template = new JPaloEngineTemplate(sb);   
         
          if(template == null){
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.