public class CryptoServiceImpl extends java.lang.Object implements CryptoService
Modifier and Type | Field and Description |
---|---|
static int |
KEY_LENGTH |
MINIMUM_KEY_SIZE_BYTES
Modifier and Type | Method and Description |
---|---|
long |
computeHashedLookupIndex(java.math.BigDecimal input,
long modulus)
Compute the cryptographic hash of a number, compressed into the range 0 to modulus - 1.
|
long |
computeHashedLookupIndex(java.nio.ByteBuffer input,
long modulus)
Compute the cryptographic hash of a byte buffer, compressed into the range 0 to modulus - 1.
|
long |
computeHashedLookupIndex(java.util.Date input,
long modulus)
Compute the cryptographic hash of a date, compressed into the range 0 to modulus - 1.
|
long |
computeHashedLookupIndex(java.lang.String input,
long modulus)
Compute the cryptographic hash of a string, compressed into the range 0 to modulus - 1.
|
CryptoService |
deriveNewKey()
Create a new cryptographic service provider by deriving a new key from this provider's key.
|
CryptoService |
deriveNewKey(byte[] salt)
Create a new cryptographic service provider by deriving a new key from this provider's key combined with the
provided salt value.
|
CryptoService |
deriveNewKey(java.lang.String salt)
Create a new cryptographic service provider by deriving a new key from this provider's key combined with the
provided salt value.
|
byte[] |
getRawKey()
Retrieve the raw key wrapped by this service provider.
|
void |
shuffleList(java.util.List<?> list)
Shuffle the provided list in-place.
|
void |
shuffleListNoCollisions(java.util.List<?> list)
Shuffle the provided list in-place.
|
CryptoService |
wrap(byte[] keyIn)
Create a new cryptographic service provider by wrapping the provided key.
|
public static final int KEY_LENGTH
public byte[] getRawKey()
CryptoService
getRawKey
in interface CryptoService
public CryptoService wrap(@Nonnull byte[] keyIn)
CryptoService
wrap
in interface CryptoService
keyIn
- The key value to usepublic CryptoService deriveNewKey()
CryptoService
deriveNewKey
in interface CryptoService
public CryptoService deriveNewKey(@Nullable byte[] salt)
CryptoService
deriveNewKey
in interface CryptoService
salt
- The salt value to usepublic CryptoService deriveNewKey(@Nullable java.lang.String salt)
CryptoService
deriveNewKey
in interface CryptoService
salt
- The salt value to usepublic final long computeHashedLookupIndex(@Nonnull java.math.BigDecimal input, long modulus)
CryptoService
computeHashedLookupIndex
in interface CryptoService
input
- The value to hashmodulus
- The modulus, which must be greater than 0public final long computeHashedLookupIndex(@Nonnull java.nio.ByteBuffer input, long modulus)
CryptoService
computeHashedLookupIndex
in interface CryptoService
input
- The value to hashmodulus
- The modulus, which must be greater than 0public final long computeHashedLookupIndex(@Nonnull java.util.Date input, long modulus)
CryptoService
computeHashedLookupIndex
in interface CryptoService
input
- The value to hashmodulus
- The modulus, which must be greater than 0public final long computeHashedLookupIndex(@Nonnull java.lang.String input, long modulus)
CryptoService
computeHashedLookupIndex
in interface CryptoService
input
- The value to hashmodulus
- The modulus, which must be greater than 0public void shuffleList(@Nonnull java.util.List<?> list)
CryptoService
shuffleList
in interface CryptoService
list
- The list to shuffle.public void shuffleListNoCollisions(@Nonnull java.util.List<?> list)
CryptoService
shuffleListNoCollisions
in interface CryptoService
list
- The list to shuffle.