Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasypt.hibernate.encryptor
Class HibernatePBEEncryptorRegistry

    Object
      org.jasypt.hibernate.encryptor.HibernatePBEEncryptorRegistry

Deprecated. Will be removed in 1.11. Package org.jasypt.hibernate.connectionprovider has been renamed as org.jasypt.hibernate3.connectionprovider.

    public final class HibernatePBEEncryptorRegistry

extends Object

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:

1. Obtain the registry instance (`getInstance()`).
2. Register the encryptor, giving it a registered name (`registerPBE*Encryptor(String, PBE*Encryptor`).
3. Declare a typedef in a Hibernate mapping giving its `encryptorRegisteredName` parameter the same value specified when registering the encryptor.

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

Method Summary
`static HibernatePBEEncryptorRegistry` | `getInstance()` Deprecated. Returns the singleton instance of the registry.
`org.jasypt.encryption.pbe.PBEBigDecimalEncryptor` | `getPBEBigDecimalEncryptor(String registeredName)` Deprecated. Returns the `PBEBigDecimalEncryptor` registered with the specified name (if exists).
`org.jasypt.encryption.pbe.PBEBigIntegerEncryptor` | `getPBEBigIntegerEncryptor(String registeredName)` Deprecated. Returns the `PBEBigIntegerEncryptor` registered with the specified name (if exists).
`org.jasypt.encryption.pbe.PBEByteEncryptor` | `getPBEByteEncryptor(String registeredName)` Deprecated. Returns the `PBEByteEncryptor` registered with the specified name (if exists).
`org.jasypt.encryption.pbe.PBEStringEncryptor` | `getPBEStringEncryptor(String registeredName)` Deprecated. Returns the `PBEStringEncryptor` registered with the specified name (if exists).
`void` | `registerPBEBigDecimalEncryptor(String registeredName, org.jasypt.encryption.pbe.PBEBigDecimalEncryptor encryptor)` Deprecated. Registers a `PBEBigDecimalEncryptor` object with the specified name.
`void` | `registerPBEBigIntegerEncryptor(String registeredName, org.jasypt.encryption.pbe.PBEBigIntegerEncryptor encryptor)` Deprecated. Registers a `PBEBigIntegerEncryptor` object with the specified name.
`void` | `registerPBEByteEncryptor(String registeredName, org.jasypt.encryption.pbe.PBEByteEncryptor encryptor)` Deprecated. Registers a `PBEByteEncryptor` object with the specified name.
`void` | `registerPBEStringEncryptor(String registeredName, org.jasypt.encryption.pbe.PBEStringEncryptor encryptor)` Deprecated. Registers a `PBEStringEncryptor` object with the specified name.

Methods inherited from class Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static HibernatePBEEncryptorRegistry getInstance()

  Deprecated.
  Returns the singleton instance of the registry.

  Returns:
    the registry.

### registerPBEStringEncryptor

    public void registerPBEStringEncryptor(String registeredName,
                                           org.jasypt.encryption.pbe.PBEStringEncryptor encryptor)

  Deprecated.
  Registers a `PBEStringEncryptor` object with the specified name.

  Parameters:
    `registeredName` - the registered name.
    `encryptor` - the encryptor to be registered.

### getPBEStringEncryptor

    public org.jasypt.encryption.pbe.PBEStringEncryptor getPBEStringEncryptor(String registeredName)

  Deprecated.
  Returns the `PBEStringEncryptor` registered with the specified name (if exists).

  Parameters:
    `registeredName` - the name with which the desired encryptor was registered.
  Returns:
    the encryptor, or null if no encryptor has been registered with that name.

### registerPBEBigIntegerEncryptor

    public void registerPBEBigIntegerEncryptor(String registeredName,
                                               org.jasypt.encryption.pbe.PBEBigIntegerEncryptor encryptor)

  Deprecated.
  Registers a `PBEBigIntegerEncryptor` object with the specified name.

  Parameters:
    `registeredName` - the registered name.
    `encryptor` - the encryptor to be registered.
  Since:
    1.6

### getPBEBigIntegerEncryptor

    public org.jasypt.encryption.pbe.PBEBigIntegerEncryptor getPBEBigIntegerEncryptor(String registeredName)

  Deprecated.
  Returns the `PBEBigIntegerEncryptor` registered with the specified name (if exists).

  Parameters:
    `registeredName` - the name with which the desired encryptor was registered.
  Returns:
    the encryptor, or null if no encryptor has been registered with that name.

### registerPBEBigDecimalEncryptor

    public void registerPBEBigDecimalEncryptor(String registeredName,
                                               org.jasypt.encryption.pbe.PBEBigDecimalEncryptor encryptor)

  Deprecated.
  Registers a `PBEBigDecimalEncryptor` object with the specified name.

  Parameters:
    `registeredName` - the registered name.
    `encryptor` - the encryptor to be registered.
  Since:
    1.6

### getPBEBigDecimalEncryptor

    public org.jasypt.encryption.pbe.PBEBigDecimalEncryptor getPBEBigDecimalEncryptor(String registeredName)

  Deprecated.
  Returns the `PBEBigDecimalEncryptor` registered with the specified name (if exists).

  Parameters:
    `registeredName` - the name with which the desired encryptor was registered.
  Returns:
    the encryptor, or null if no encryptor has been registered with that name.

### registerPBEByteEncryptor

    public void registerPBEByteEncryptor(String registeredName,
                                         org.jasypt.encryption.pbe.PBEByteEncryptor encryptor)

  Deprecated.
  Registers a `PBEByteEncryptor` object with the specified name.

  Parameters:
    `registeredName` - the registered name.
    `encryptor` - the encryptor to be registered.
  Since:
    1.6

### getPBEByteEncryptor

    public org.jasypt.encryption.pbe.PBEByteEncryptor getPBEByteEncryptor(String registeredName)

  Deprecated.
  Returns the `PBEByteEncryptor` registered with the specified name (if exists).

  Parameters:
    `registeredName` - the name with which the desired encryptor was registered.
  Returns:
    the encryptor, or null if no encryptor has been registered with that name.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2014 The JASYPT team. All Rights Reserved.