Package org.keycloak.storage.jpa
Class KeyUtils
java.lang.Object
org.keycloak.storage.jpa.KeyUtils
- Author:
- hmlnarik
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertValidKey
(String key) Logs a warning when the key is not a valid keystatic boolean
isValidKey
(String key) Check if a string is a valid key.
-
Field Details
-
UUID_PATTERN
-
SHORT_ID_PATTERN
-
EXPECTED_KEY_PATTERN
-
-
Constructor Details
-
KeyUtils
public KeyUtils()
-
-
Method Details
-
isValidKey
Check if a string is a valid key.- Parameters:
key
- String representation of the key- Returns:
- true when the key is
null
or either a plain UUID or a key formatted as "f:[UUID]:any_string" or "f:[SHORT_ID]:any_string"
-
assertValidKey
Logs a warning when the key is not a valid key- Parameters:
key
- String representation of the key- Throws:
IllegalArgumentException
-