Package sun.misc

Examples of sun.misc.BASE64Decoder.decodeBuffer()


       
       
        paramSpec = new PBEParameterSpec(passwordSalt,ITERATIONS);
        cipher.init(Cipher.DECRYPT_MODE,secretKey,paramSpec);
        String secretPassword = URLDecoder.decode(encryptedCredentials[1],"UTF-8");
        byte[] passwordBytes = cipher.doFinal(decoder.decodeBuffer(secretPassword));
        String password = new String(passwordBytes);
       
        credentials = new TaggingCredential(bookmarkingSource.getType(),login,password);
       
        addToMap(sscfPerson,credentials);
View Full Code Here


        // Now, that data is supposed to be a single X.509 certificate or
        // X.509 CRL or PKCS#7 formatted data... Base64 encoded.
        // Decode into binary and return the result.
        BASE64Decoder decoder = new BASE64Decoder();
        return decoder.decodeBuffer(strBuf.toString());
    }

    /*
     * Reads the entire input stream into a byte array.
     */
 
View Full Code Here

                    if (decoder == null)
                        decoder = new BASE64Decoder();

                    RefAddr ra = (RefAddr)
                        deserializeObject(
                            decoder.decodeBuffer(val.substring(start)),
                            cl);

                    refAddrList.setElementAt(ra, posn);
                } else {
                    // Single separator indicates a StringRefAddr
View Full Code Here

                while ((line = certBufferedReader.readLine()) != null) {
                    if (line.equals(X509Factory.END_CERT)) {
                        der = new DerValue(decstream.toByteArray());
                        break;
                    } else {
                        decstream.write(decoder.decodeBuffer(line));
                    }
                }
            } catch (IOException ioe2) {
                throw new IOException("Unable to read InputStream: "
                                      + ioe2.getMessage());
View Full Code Here

                while ((line = certBufferedReader.readLine()) != null) {
                    if (line.equals(X509Factory.END_CERT)) {
                        der = new DerValue(decstream.toByteArray());
                        break;
                    } else {
                        decstream.write(decoder.decodeBuffer(line));
                    }
                }
            } catch (IOException ioe2) {
                throw new IOException("Unable to read InputStream: "
                                      + ioe2.getMessage());
View Full Code Here

            SecretKeySpec key = new SecretKeySpec(strkey.getBytes(), "Blowfish");
            Cipher cipher = Cipher.getInstance("Blowfish");
            cipher.init(Cipher.DECRYPT_MODE, key);

            BASE64Decoder dec = new BASE64Decoder();
            byte[] bytes = dec.decodeBuffer(to_decrypt);

            byte[] decrypted = cipher.doFinal(bytes);

            return new String(decrypted);
        } catch (Exception e) {
View Full Code Here

     * @return String
     * @throws IOException
     */
    public static String decodeString(String str) throws IOException {
        BASE64Decoder dec = new BASE64Decoder();
        String value = new String(dec.decodeBuffer(str));
       
        return (value);
    }
   
    /**
 
View Full Code Here

  public static final String decryptPassword(String encryptedPassword) {
    if (decPassword == null) {
      try {
        BASE64Decoder base64decoder = new BASE64Decoder();
        byte[] encrypedPwdBytes = base64decoder.decodeBuffer(encryptedPassword);

        Cipher cipher = Cipher.getInstance("DES");
        cipher.init(Cipher.DECRYPT_MODE, getKey());
        byte[] plainTextPwdBytes = (cipher.doFinal(encrypedPwdBytes));
        decPassword = new String(plainTextPwdBytes);
View Full Code Here

     * Returns the unencrypted contents of the supplied encrypted, base64 encoded string.
     */
    public String decrypt(String encryptedData) {
        try {
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] inputBytes = decoder.decodeBuffer(encryptedData);

            PBEKeySpec keySpec = new PBEKeySpec(key);
            SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
            SecretKey key = factory.generateSecret(keySpec);

View Full Code Here

    boolean error = false;
    if(file != null) {
      String content = file.substring(file.indexOf(',') + 1);
      BASE64Decoder decoder = new BASE64Decoder();
      try {
        byte[] decodedBytes = decoder.decodeBuffer(content);
        try {
          plugin = plugins.add(name, decodedBytes);
        } catch (CrawljaxWebException e) {
          LogWebSocketServlet.sendToAll("message-error-" + e.getMessage());
          error = true;
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.