public class KeyGenerators
extends java.lang.Object
BytesKeyGenerator or StringKeyGenerator.| Modifier and Type | Method and Description | 
|---|---|
| static BytesKeyGenerator | secureRandom()Create a  BytesKeyGeneratorthat uses aSecureRandomto generate
 keys of 8 bytes in length. | 
| static BytesKeyGenerator | secureRandom(int keyLength)Create a  BytesKeyGeneratorthat uses aSecureRandomto generate
 keys of a custom length. | 
| static BytesKeyGenerator | shared(int keyLength)Create a  BytesKeyGeneratorthat returns a single, sharedSecureRandomkey of a custom length. | 
| static StringKeyGenerator | string()Creates a  StringKeyGeneratorthat hex-encodesSecureRandomkeys of
 8 bytes in length. | 
public static BytesKeyGenerator secureRandom()
BytesKeyGenerator that uses a SecureRandom to generate
 keys of 8 bytes in length.public static BytesKeyGenerator secureRandom(int keyLength)
BytesKeyGenerator that uses a SecureRandom to generate
 keys of a custom length.keyLength - the key length in bytes, e.g. 16, for a 16 byte key.public static BytesKeyGenerator shared(int keyLength)
BytesKeyGenerator that returns a single, shared
 SecureRandom key of a custom length.keyLength - the key length in bytes, e.g. 16, for a 16 byte key.public static StringKeyGenerator string()
StringKeyGenerator that hex-encodes SecureRandom keys of
 8 bytes in length. The hex-encoded string is keyLength * 2 characters in length.