Search in sources :

Example 1 with InlineKeystore

use of com.adaptris.security.keystore.InlineKeystore in project interlok by adaptris.

the class TestInlineKeystore method setUp.

@Override
@Before
public void setUp() throws Exception {
    config = Config.getInstance();
    inline = new InlineKeystore();
    inline.setCertificate(EXAMPLE_KEYINFO);
    inline.setType(Constants.KEYSTORE_XMLKEYINFO);
    inline.setAlias("MyAlias");
    copy = new InlineKeystore();
    copy.setCertificate(EXAMPLE_KEYINFO);
    copy.setType(Constants.KEYSTORE_XMLKEYINFO);
    copy.setAlias("MyAlias");
    kloc = inline.asKeystoreLocation();
}
Also used : InlineKeystore(com.adaptris.security.keystore.InlineKeystore) Before(org.junit.Before)

Example 2 with InlineKeystore

use of com.adaptris.security.keystore.InlineKeystore in project interlok by adaptris.

the class EncryptionServiceCase method applyConfigForSamples.

protected static void applyConfigForSamples(CoreSecurityService service) {
    try {
        service.setLocalPartner("local partner alias in keystore");
        service.setRemotePartner("remote partner alias in keystore");
        service.addKeystoreUrl(new ConfiguredUrl("http://localhost/path/to/JKS/keystore?keystoreType=" + "JKS&keystorePassword=somePlainTextPassword"));
        service.addKeystoreUrl(new ConfiguredUrl("file://localhost/path/to/a/X509/Certificate?keystoreType=" + "X509?keystoreAlias=CertificateAlias"));
        service.addKeystoreUrl(new ConfiguredUrl("file://localhost/path/to/another/X509/Certificate?keystoreType=" + "X509?keystoreAlias=AnotherAlias"));
        service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/a/PKCS12/Keystore?keystoreType=" + "PKCS12&keystoreAlias=PKCS12Alias", "PW:AAAAEF+zZCbvHeIXDx8HUslqiYwAAAAQ3wi4/BVycX+uzc5zF4F6EQAAABD0hhpr46IrKSu7XxFhEAYN"));
        // service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/keystore?keystoreType=" + "PKCS12&keystoreAlias=myalias",
        // PROPERTIES.getProperty(SECURITY_PASSWORD)));
        service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/a/JCE/keystore?keystoreType=JCEKS", "ALTPW:AAAAEF+zZCbvHeIXDx8HUslqiYwAAAAQ3wi4/BVycX+uzc5zF4F6EQAAABD0hhpr46IrKSu7XxFhEAYN"));
        // service.addKeystoreUrl(new ConfiguredUrl("http://host/path/to/keystore?keystoreType=" + "JCEKS&keystoreAlias=myalias",
        // Password.encode(PROPERTIES.getProperty(SECURITY_PASSWORD), Password.NON_PORTABLE_PASSWORD)));
        service.addKeystoreUrl(new ConfiguredUrl("file://local/path/to/anoter/JKS/keystore?keystoreType=" + "JKS&keystoreAlias=myalias", "somePlainTextPassword"));
        InlineKeystore inline = new InlineKeystore();
        inline.setCertificate(EXAMPLE_KEYINFO);
        inline.setType(Constants.KEYSTORE_XMLKEYINFO);
        inline.setAlias("myAlias");
        service.addKeystoreUrl(inline);
        addEncryptionAlgsForFactoryType(service);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : InlineKeystore(com.adaptris.security.keystore.InlineKeystore) ConfiguredUrl(com.adaptris.security.keystore.ConfiguredUrl) ServiceException(com.adaptris.core.ServiceException) AdaptrisSecurityException(com.adaptris.security.exc.AdaptrisSecurityException)

Aggregations

InlineKeystore (com.adaptris.security.keystore.InlineKeystore)2 ServiceException (com.adaptris.core.ServiceException)1 AdaptrisSecurityException (com.adaptris.security.exc.AdaptrisSecurityException)1 ConfiguredUrl (com.adaptris.security.keystore.ConfiguredUrl)1 Before (org.junit.Before)1