Registry for all the PBE*Encryptor which are eligible for use from Hibernate.
This class is intended to be directly used in applications where an IoC container (like Spring Framework) is not present. If it is, it is better to use the HibernatePBE*Encryptor classes directly, instead.
This registry is a singleton which maintains a registry of PBE*Encryptor objects which can be used from Hibernate, by using its registeredName to reference them from mappings.
The steps would be:
This is, first register the encryptor (example with a String encryptor):
StandardPBEStringEncryptor myEncryptor = new StandardPBEStringEncryptor(); ... HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance(); registry.registerPBEStringEncryptor("myHibernateEncryptor", myEncryptor);
And then, reference it from a Hibernate mapping file:
<typedef name="encryptedString" class="org.jasypt.hibernate.type.EncryptedStringType"> <param name="encryptorRegisteredName">myHibernateEncryptor</param> </typedef>@since 1.2 (class existed as org.jasypt.hibernate.HibernatePBEEncryptorRegistry since 1.0) @author Daniel Fernández
|
|
|
|
|
|
|
|
|
|
|
|