public class AndroidKeyGenerators
extends java.lang.Object
BytesKeyGenerator
or
StringKeyGenerator
.Modifier and Type | Method and Description |
---|---|
static org.springframework.security.crypto.keygen.BytesKeyGenerator |
secureRandom()
Create a
BytesKeyGenerator that uses a SecureRandom to generate keys of 8 bytes in length. |
static org.springframework.security.crypto.keygen.BytesKeyGenerator |
secureRandom(int keyLength)
Create a
BytesKeyGenerator that uses a SecureRandom to generate keys of a custom length. |
static org.springframework.security.crypto.keygen.BytesKeyGenerator |
shared(int keyLength)
Create a
BytesKeyGenerator that returns a single, shared SecureRandom key of a custom length. |
static org.springframework.security.crypto.keygen.StringKeyGenerator |
string()
Creates a
StringKeyGenerator that hex-encodes SecureRandom keys of 8 bytes in length. |
public static org.springframework.security.crypto.keygen.BytesKeyGenerator secureRandom()
BytesKeyGenerator
that uses a SecureRandom
to generate keys of 8 bytes in length.public static org.springframework.security.crypto.keygen.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 org.springframework.security.crypto.keygen.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 org.springframework.security.crypto.keygen.StringKeyGenerator string()
StringKeyGenerator
that hex-encodes SecureRandom
keys of 8 bytes in length. The
hex-encoded string is keyLength * 2 characters in length.