Package alpine.auth
Class ApiKeyGenerator
- java.lang.Object
-
- alpine.auth.ApiKeyGenerator
-
public final class ApiKeyGenerator extends Object
Class used to securely generate API keys.- Since:
- 1.0.0
- Author:
- Steve Springett
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringgenerate()Generates a 32 character cryptographically secure API key.static Stringgenerate(int chars)Generates a cryptographically secure API key of the specified length.
-
-
-
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
-
-