use of org.apache.wicket.util.crypt.CachingSunJceCryptFactory in project wicket by apache.
the class DefaultAuthenticationStrategy method getCrypt.
/**
* @return The crypt engine to be used
*/
protected ICrypt getCrypt() {
if (crypt == null) {
CachingSunJceCryptFactory cryptFactory = new CachingSunJceCryptFactory(encryptionKey);
crypt = cryptFactory.newCrypt();
}
return crypt;
}
use of org.apache.wicket.util.crypt.CachingSunJceCryptFactory in project wicket by apache.
the class CryptoMapperTest method before.
/**
* Creates the {@link CryptoMapper}
*
* @throws Exception
*/
@Before
public void before() throws Exception {
tester = new WicketTester(HomePage.class);
WebApplication application = tester.getApplication();
application.mountPage(MOUNTED_URL, Page1.class);
/**
* Use explicit crypt provider to prevent crypt warning output, see
* SecuritySettings#getCryptFactory()
*/
Supplier<ICrypt> cryptProvider = new Supplier<ICrypt>() {
private ICryptFactory cryptFactory = new CachingSunJceCryptFactory(SecuritySettings.DEFAULT_ENCRYPTION_KEY);
@Override
public ICrypt get() {
return cryptFactory.newCrypt();
}
};
mapper = new CryptoMapper(application.getRootRequestMapper(), cryptProvider);
}
Aggregations