Search in sources :

Example 11 with ConfiguredUrl

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

the class TestDefaultSecurityService method setUp.

@Before
public void setUp() throws Exception {
    config = Config.getInstance().getProperties();
    if (config == null) {
        fail("No Configuration(!) available");
    }
    ConfiguredUrl configuredKeystore = new ConfiguredUrl();
    configuredKeystore.setUrl(config.getProperty(Config.KEYSTORE_TEST_URL) + "&" + Constants.KEYSTORE_PASSWORD + "=" + config.getProperty(Config.KEYSTORE_COMMON_KEYSTORE_PW));
    Config.getInstance().buildKeystore(config.getProperty(Config.KEYSTORE_TEST_URL), null, true);
    service = SecurityServiceFactory.defaultInstance().createService();
    service.registerKeystore(configuredKeystore);
    EncryptionAlgorithm alg = new EncryptionAlgorithm(config.getProperty(Config.SECURITY_ALG), config.getProperty(Config.SECURITY_ALGSIZE));
    service.setEncryptionAlgorithm(alg);
    us = new Alias(config.getProperty(Config.KEYSTORE_COMMON_PRIVKEY_ALIAS), config.getProperty(Config.KEYSTORE_COMMON_PRIVKEY_PW));
    them = new Alias(config.getProperty(Config.KEYSTORE_COMMON_PRIVKEY_ALIAS));
}
Also used : ConfiguredUrl(com.adaptris.security.keystore.ConfiguredUrl) Alias(com.adaptris.security.keystore.Alias) Before(org.junit.Before)

Aggregations

ConfiguredUrl (com.adaptris.security.keystore.ConfiguredUrl)11 Test (org.junit.Test)7 CoreException (com.adaptris.core.CoreException)2 Alias (com.adaptris.security.keystore.Alias)2 Before (org.junit.Before)2 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)1 ServiceException (com.adaptris.core.ServiceException)1 AdaptrisSecurityException (com.adaptris.security.exc.AdaptrisSecurityException)1 ConfiguredKeystore (com.adaptris.security.keystore.ConfiguredKeystore)1 InlineKeystore (com.adaptris.security.keystore.InlineKeystore)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1