Class Base64StringKeyGenerator

java.lang.Object
org.springframework.security.crypto.keygen.Base64StringKeyGenerator
All Implemented Interfaces:
StringKeyGenerator

public class Base64StringKeyGenerator extends Object implements StringKeyGenerator
A StringKeyGenerator that generates base64-encoded String keys. Delegates to a BytesKeyGenerator for the actual key generation.
Since:
5.0
  • 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

      public Base64StringKeyGenerator(Base64.Encoder encoder)
      Creates an instance with keyLength of 32 bytes and the provided encoder.
      Parameters:
      encoder - the encoder to use
    • Base64StringKeyGenerator

      public Base64StringKeyGenerator(Base64.Encoder encoder, int keyLength)
      Creates an instance with the provided key length and encoder.
      Parameters:
      encoder - the encoder to use
      keyLength - the key length to use
  • Method Details