Examples of Base64


Examples of org.apache.commons.codec.binary.Base64

   public void getMessages()
       throws Exception
   {
       HttpClient client = new HttpClient();
       GetMethod method = new GetMethod(MessageReceiverGetURL);
       Base64 base64 = new Base64();
       String base64Credentials = new String(base64.encode("admin:admin".getBytes()));
       method.addRequestHeader(new Header("Authorization", "Basic " + base64Credentials));
       int status = client.executeMethod(method);
       if (HttpResponseCodes.SC_OK != status) {
           throw new RuntimeException("Messages can not be received");
       }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

   public void getMessagesFromSubscriberReceiver()
       throws Exception
    {
       HttpClient client = new HttpClient();
       GetMethod method = new GetMethod(MessageReceiverSubscriberGetURL);
       Base64 base64 = new Base64();
       String base64Credentials = new String(base64.encode("admin:admin".getBytes()));
       method.addRequestHeader(new Header("Authorization", "Basic " + base64Credentials));
       int status = client.executeMethod(method);
       if (HttpResponseCodes.SC_OK != status) {
           throw new RuntimeException("Messages can not be received");
       }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

                                    );
                                }
                            }
                            byte[] encryptedEphemeralKey = cipher.wrap(sessionKey);

                            createCharactersAndOutputAsEvent(outputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(encryptedEphemeralKey));

                        } catch (NoSuchPaddingException e) {
                            throw new XMLSecurityException(e);
                        } catch (NoSuchAlgorithmException e) {
                            throw new XMLSecurityException(e);
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

                        SynapseConstants.SYNPASE_HTTP_PROXY_USER);
                String password = synapseProperties.getProperty(
                        SynapseConstants.SYNPASE_HTTP_PROXY_PASSWORD);
                if (userName != null && password != null) {
                    String header = userName + ":" + password;
                    byte[] encodedHeaderBytes = new Base64().encode(header.getBytes());
                    String encodedHeader = new String(encodedHeaderBytes);

                    connection.setRequestProperty("Proxy-Authorization", "Basic " + encodedHeader);
                }
            } else {
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

            return NULL_STRING;
        }

        byte[] encodedValue;
        try {
            encodedValue = new Base64().encode(value.getBytes(encoding));
        } catch (UnsupportedEncodingException e) {
            String msg = "Unsupported Encoding";
            log.error(msg, e);
            throw new FunctionCallException(msg, e);
        }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

        byte[] keyContent = new byte[dataLength];

        System.arraycopy(keyBytes, dataStart, keyContent, 0, dataLength);

        PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(
                new Base64().decode(keyContent));
        try {
            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
            return keyFactory.generatePrivate(pkcs8EncodedKeySpec);
        } catch (NoSuchAlgorithmException e) {
            handleException("Error getting a KeyFactory instance", e);
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

        }
    }

    public static final byte[] encode(byte[] bytes)
    {
          return new Base64().encode(bytes);
    }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

        }
    }

    public static final byte[] decode(byte[] bytes)
    {
          return new Base64().decode(bytes);
    }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

       
        byte[] iv = null;
        String _iv = ctx.getInitParameter(INIT_ALGORITHM_IV);
       
        if (_iv != null)
            iv = new Base64().decode(_iv.getBytes());
       
        return iv;
    }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64

            if(log.isLoggable(Level.FINE))
                log.fine("generated random password of length " + length);
        }
        else
        {
            bytes = new Base64().decode(_secret.getBytes());
        }
       
        return bytes;
    }
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.