Package alpine.security
Class ApiKeyGenerator
java.lang.Object
alpine.security.ApiKeyGenerator
Class used to securely generate API keys.
- Since:
- 1.0.0
- Author:
- Steve Springett
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringgenerate()Generates a prefixed cryptographically secure API key of 32 characters not including the prefix length.static Stringgenerate(int chars) Generates a cryptographically secure API key of the specified length having the configured API key prefix.
-
Method Details
-
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
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
-