Package alpine.auth

Class ApiKeyGenerator


  • public final class ApiKeyGenerator
    extends Object
    Class used to securely generate API keys.
    Since:
    1.0.0
    Author:
    Steve Springett
    • Method Detail

      • generate

        public static String generate()
        Generates a 32 character cryptographically secure API key.
        Returns:
        a String representation of the API key
        Since:
        1.0.0
      • generate

        public static String generate​(int chars)
        Generates a cryptographically secure API key of the specified length.
        Parameters:
        chars - the length of the API key to generate
        Returns:
        a String representation of the API key