CryptoFactoryBean implements FactoryBean<Crypto>, InitializingBean { public void setConfiguration(Properties properties) { Assert.notNull(properties, "'properties' must not be null"); this.configuration.putAll(properties); }  void setConfiguration(Properties properties); void setCryptoProvider(Class<? extends Crypto> cryptoProviderClass); void setKeyStoreLocation(Resource location); void setKeyStoreProvider(String provider); void setKeyStorePassword(String password); void setKeyStoreType(String type); void setTrustStorePassword(String password); void setDefaultX509Alias(String defaultX509Alias); @Override void afterPropertiesSet(); @Override Class<Crypto> getObjectType(); @Override boolean isSingleton(); @Override Crypto getObject();  }
@Test public void testSetConfiguration() throws Exception { Properties configuration = new Properties(); configuration.setProperty("org.apache.ws.security.crypto.provider", "org.apache.ws.security.components.crypto.Merlin"); configuration.setProperty("org.apache.ws.security.crypto.merlin.keystore.type", "jceks"); configuration.setProperty("org.apache.ws.security.crypto.merlin.keystore.password", "123456"); configuration.setProperty("org.apache.ws.security.crypto.merlin.file", "private.jks"); factoryBean.setConfiguration(configuration); factoryBean.afterPropertiesSet(); Object result = factoryBean.getObject(); Assert.assertNotNull("No result", result); Assert.assertTrue("Not a Merlin instance", result instanceof Merlin); }