Search in sources :

Example 51 with KeyStoreParameters

use of org.apache.camel.util.jsse.KeyStoreParameters in project camel by apache.

the class FileToFtpsExplicitTLSWithoutClientAuthAndSSLContextParametersTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource("server.jks");
    ksp.setPassword("password");
    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);
    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setSecureSocketProtocol("TLS");
    sslContextParameters.setTrustManagers(tmp);
    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 52 with KeyStoreParameters

use of org.apache.camel.util.jsse.KeyStoreParameters in project camel by apache.

the class FileToFtpsImplicitSSLWithClientAuthAndSSLContextParametersTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource("server.jks");
    ksp.setPassword("password");
    KeyManagersParameters kmp = new KeyManagersParameters();
    kmp.setKeyPassword("password");
    kmp.setKeyStore(ksp);
    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);
    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setSecureSocketProtocol("SSL");
    sslContextParameters.setKeyManagers(kmp);
    sslContextParameters.setTrustManagers(tmp);
    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
}
Also used : KeyManagersParameters(org.apache.camel.util.jsse.KeyManagersParameters) JndiRegistry(org.apache.camel.impl.JndiRegistry) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 53 with KeyStoreParameters

use of org.apache.camel.util.jsse.KeyStoreParameters in project camel by apache.

the class FileToFtpsImplicitSSLWithoutClientAuthAndSSLContextParametersTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource("server.jks");
    ksp.setPassword("password");
    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);
    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setSecureSocketProtocol("SSL");
    sslContextParameters.setTrustManagers(tmp);
    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 54 with KeyStoreParameters

use of org.apache.camel.util.jsse.KeyStoreParameters in project camel by apache.

the class FileToFtpsImplicitTLSWithoutClientAuthAndSSLContextParametersTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource("server.jks");
    ksp.setPassword("password");
    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);
    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setSecureSocketProtocol("TLS");
    sslContextParameters.setTrustManagers(tmp);
    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 55 with KeyStoreParameters

use of org.apache.camel.util.jsse.KeyStoreParameters in project camel by apache.

the class SignatureTests method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    KeyStore keystore = loadKeystore();
    Certificate cert = keystore.getCertificate("bob");
    KeyStoreParameters keystoreParameters = new KeyStoreParameters();
    keystoreParameters.setPassword("letmein");
    keystoreParameters.setResource("./ks.keystore");
    registry.bind("signatureParams", keystoreParameters);
    registry.bind("keystore", keystore);
    registry.bind("myPublicKey", cert.getPublicKey());
    registry.bind("myCert", cert);
    registry.bind("myPrivateKey", keystore.getKey("bob", "letmein".toCharArray()));
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) KeyStore(java.security.KeyStore) Certificate(java.security.cert.Certificate)

Aggregations

KeyStoreParameters (org.apache.camel.util.jsse.KeyStoreParameters)57 SSLContextParameters (org.apache.camel.util.jsse.SSLContextParameters)31 KeyManagersParameters (org.apache.camel.util.jsse.KeyManagersParameters)25 RouteBuilder (org.apache.camel.builder.RouteBuilder)24 TrustManagersParameters (org.apache.camel.util.jsse.TrustManagersParameters)24 Test (org.junit.Test)21 JndiRegistry (org.apache.camel.impl.JndiRegistry)17 SSLContextServerParameters (org.apache.camel.util.jsse.SSLContextServerParameters)7 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)4 HashMap (java.util.HashMap)3 Exchange (org.apache.camel.Exchange)3 Processor (org.apache.camel.Processor)3 IOException (java.io.IOException)2 GeneralSecurityException (java.security.GeneralSecurityException)2 KeyStore (java.security.KeyStore)2 Document (org.w3c.dom.Document)2 NodeList (org.w3c.dom.NodeList)2 PrivateKey (java.security.PrivateKey)1 Signature (java.security.Signature)1 Certificate (java.security.cert.Certificate)1