Interface WebPBEInitializer
-
public interface WebPBEInitializerInterface which must be implemented by the user-defined classes which create and initialize webapp PBE encryptors for being configured through the web pbe configuration servlet.
This interface only has one method,
initializeWebPBEConfigs(), which the implementation class should use for creating encryptors and settingWebPBEConfigobjects to them, like:package myapp; ... public class MyWebPBEInitializer implements WebPBEInitializer { public void initializeWebPBEConfigs() { StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); encryptor.setAlgorithm("PBEWithMD5AndDES"); WebPBEConfig webConfig = new WebPBEConfig(); webConfig.setValidationWord("jasypt"); webConfig.setName("Main Password"); encryptor.setConfig(webConfig); // Get some user-defined singleton or similar, and register // the encryptor with it so that it can be accessed from the // rest of the application. } }All WebPBEConfig objects get internally registered at instantiation time, and once assigned to an encryptor they will appear in the web form for password setting.
Important: If the web application uses Spring Framework, WebPBEConfig objects are declared as beans in the Spring context and this Spring context is initialized at application deploy time (with Spring's ContextLoaderListener), it will NOT be necessary to create any classes implementing this WebPBEInitializer interface. The use
WebPBEInitializationContextListenerwill also become unnecessary.- Since:
- 1.3
- Author:
- Daniel Fernández
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinitializeWebPBEConfigs()Method called byWebPBEInitializationContextListenerat application deploy time for initialization of jasypt encryptors.
-
-
-
Method Detail
-
initializeWebPBEConfigs
void initializeWebPBEConfigs()
Method called by
WebPBEInitializationContextListenerat application deploy time for initialization of jasypt encryptors.
-
-