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()
CryptoServicegetRawKey in interface CryptoServicepublic CryptoService wrap(@Nonnull byte[] keyIn)
CryptoServicewrap in interface CryptoServicekeyIn - The key value to usepublic CryptoService deriveNewKey()
CryptoServicederiveNewKey in interface CryptoServicepublic CryptoService deriveNewKey(@Nullable byte[] salt)
CryptoServicederiveNewKey in interface CryptoServicesalt - The salt value to usepublic CryptoService deriveNewKey(@Nullable java.lang.String salt)
CryptoServicederiveNewKey in interface CryptoServicesalt - The salt value to usepublic final long computeHashedLookupIndex(@Nonnull
java.math.BigDecimal input,
long modulus)
CryptoServicecomputeHashedLookupIndex in interface CryptoServiceinput - The value to hashmodulus - The modulus, which must be greater than 0public final long computeHashedLookupIndex(@Nonnull
java.nio.ByteBuffer input,
long modulus)
CryptoServicecomputeHashedLookupIndex in interface CryptoServiceinput - The value to hashmodulus - The modulus, which must be greater than 0public final long computeHashedLookupIndex(@Nonnull
java.util.Date input,
long modulus)
CryptoServicecomputeHashedLookupIndex in interface CryptoServiceinput - The value to hashmodulus - The modulus, which must be greater than 0public final long computeHashedLookupIndex(@Nonnull
java.lang.String input,
long modulus)
CryptoServicecomputeHashedLookupIndex in interface CryptoServiceinput - The value to hashmodulus - The modulus, which must be greater than 0public void shuffleList(@Nonnull
java.util.List<?> list)
CryptoServiceshuffleList in interface CryptoServicelist - The list to shuffle.public void shuffleListNoCollisions(@Nonnull
java.util.List<?> list)
CryptoServiceshuffleListNoCollisions in interface CryptoServicelist - The list to shuffle.