Class Base64StringKeyGenerator

  • All Implemented Interfaces:
    StringKeyGenerator

    public class Base64StringKeyGenerator
    extends java.lang.Object
    implements StringKeyGenerator
    A StringKeyGenerator that generates base64-encoded String keys. Delegates to a BytesKeyGenerator for the actual key generation.
    Since:
    5.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Base64StringKeyGenerator()
      Creates 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​(java.util.Base64.Encoder encoder)
      Creates an instance with keyLength of 32 bytes and the provided encoder.
      Base64StringKeyGenerator​(java.util.Base64.Encoder encoder, int keyLength)
      Creates an instance with the provided key length and encoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String generateKey()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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​(java.util.Base64.Encoder encoder)
        Creates an instance with keyLength of 32 bytes and the provided encoder.
        Parameters:
        encoder - the encoder to use
      • Base64StringKeyGenerator

        public Base64StringKeyGenerator​(java.util.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