Class ApiKeyGenerator

java.lang.Object
alpine.security.ApiKeyGenerator

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

    • generate

      public static String generate()
      Generates a prefixed cryptographically secure API key of 32 characters not including the prefix length.
      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 having the configured API key prefix.
      Parameters:
      chars - the length of the API key to generate not including the prefix length
      Returns:
      a String representation of the API key