public interface CryptoService
Modifier and Type | Field and Description |
---|---|
static int |
MINIMUM_KEY_SIZE_BYTES
The minimum length allowed for keys in 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[] key)
Create a new cryptographic service provider by wrapping the provided key.
|
static final int MINIMUM_KEY_SIZE_BYTES
byte[] getRawKey()
CryptoService wrap(@Nonnull byte[] key)
key
- The key value to useCryptoService deriveNewKey()
CryptoService deriveNewKey(@Nullable byte[] salt)
salt
- The salt value to useCryptoService deriveNewKey(@Nullable java.lang.String salt)
salt
- The salt value to uselong computeHashedLookupIndex(@Nonnull java.math.BigDecimal input, long modulus)
input
- The value to hashmodulus
- The modulus, which must be greater than 0long computeHashedLookupIndex(@Nonnull java.nio.ByteBuffer input, long modulus)
input
- The value to hashmodulus
- The modulus, which must be greater than 0long computeHashedLookupIndex(@Nonnull java.util.Date input, long modulus)
input
- The value to hashmodulus
- The modulus, which must be greater than 0long computeHashedLookupIndex(@Nonnull java.lang.String input, long modulus)
input
- The value to hashmodulus
- The modulus, which must be greater than 0void shuffleList(@Nonnull java.util.List<?> list)
list
- The list to shuffle.void shuffleListNoCollisions(@Nonnull java.util.List<?> list)
list
- The list to shuffle.