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.salt
Class FixedStringSaltGenerator

    Object
      org.jasypt.salt.FixedStringSaltGenerator

All Implemented Interfaces:
  SaltGenerator

Deprecated. Deprecated in 1.9.2 in favour of `StringFixedSaltGenerator`, which implements the new `FixedSaltGenerator` interface and therefore is able to benefit from the performance improvements associated with it. This class will be removed in 1.10.0 (or 2.0.0).

    public class FixedStringSaltGenerator

extends Object
implements SaltGenerator

This implementation of `SaltGenerator` always returns a fixed salt set by the user as a String, which is returned as salt bytes using the specified charset for conversion (UTF-8 by default).

If the requested salt has a size in bytes smaller than the specified salt, the first n bytes are returned. If it is larger, an exception is thrown.

This class is thread-safe.

Since:
  1.2
Author:
  Daniel Fernández

Constructor Summary
`FixedStringSaltGenerator()` Deprecated. Creates a new instance of `FixedStringSaltGenerator`

Method Summary
`byte[]` | `generateSalt(int lengthBytes)` Deprecated. Return salt with the specified byte length.
`boolean` | `includePlainSaltInEncryptionResults()` Deprecated. As this salt generator provides a fixed salt, its inclusion unencrypted in encryption results is not necessary, and in fact not desirable (so that it remains hidden).
`void` | `setCharset(String charset)` Deprecated. Sets the charset to be applied to the salt for conversion into bytes.
`void` | `setSalt(String salt)` Deprecated. Sets the salt to be returned.

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

Constructor Detail

### FixedStringSaltGenerator

    public FixedStringSaltGenerator()

  Deprecated.
  Creates a new instance of `FixedStringSaltGenerator`

Method Detail

### setSalt

    public void setSalt(String salt)

  Deprecated.
  Sets the salt to be returned.

  Parameters:
    `salt` - the specified salt.

### setCharset

    public void setCharset(String charset)

  Deprecated.
  Sets the charset to be applied to the salt for conversion into bytes.

  Parameters:
    `charset` - the specified charset

### generateSalt

    public byte[] generateSalt(int lengthBytes)

  Deprecated.
  Return salt with the specified byte length.

  Specified by:
    `generateSalt` in interface `SaltGenerator`
  Parameters:
    `lengthBytes` - length in bytes.
  Returns:
    the generated salt.

### includePlainSaltInEncryptionResults

    public boolean includePlainSaltInEncryptionResults()

  Deprecated.
  As this salt generator provides a fixed salt, its inclusion unencrypted in encryption results is not necessary, and in fact not desirable (so that it remains hidden).

  Specified by:
    `includePlainSaltInEncryptionResults` in interface `SaltGenerator`
  Returns:
    false

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.