Class Base64StringKeyGenerator
java.lang.Object
org.springframework.security.crypto.keygen.Base64StringKeyGenerator
- All Implemented Interfaces:
StringKeyGenerator
A StringKeyGenerator that generates base64-encoded String keys. Delegates to a
BytesKeyGenerator
for the actual key generation.- Since:
- 5.0
-
Constructor Summary
ConstructorDescriptionCreates an instance with keyLength of 32 bytes and standard Base64 encoding.Base64StringKeyGenerator
(int keyLength) Creates an instance with the provided key length in bytes and standard Base64 encoding.Base64StringKeyGenerator
(Base64.Encoder encoder) Creates an instance with keyLength of 32 bytes and the provided encoder.Base64StringKeyGenerator
(Base64.Encoder encoder, int keyLength) Creates an instance with the provided key length and encoder. -
Method Summary
-
Constructor Details
-
Base64StringKeyGenerator
public Base64StringKeyGenerator()Creates an instance with keyLength of 32 bytes and standard Base64 encoding. -
Base64StringKeyGenerator
public Base64StringKeyGenerator(int keyLength) Creates an instance with the provided key length in bytes and standard Base64 encoding.- Parameters:
keyLength
- the key length in bytes
-
Base64StringKeyGenerator
Creates an instance with keyLength of 32 bytes and the provided encoder.- Parameters:
encoder
- the encoder to use
-
Base64StringKeyGenerator
Creates an instance with the provided key length and encoder.- Parameters:
encoder
- the encoder to usekeyLength
- the key length to use
-
-
Method Details
-
generateKey
- Specified by:
generateKey
in interfaceStringKeyGenerator
-