org.keycloak.storage.jpa

## Class KeyUtils

- java.lang.Object
- - org.keycloak.storage.jpa.KeyUtils

-     public class KeyUtils
      extends Object

  Author:
    hmlnarik

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Pattern` | `EXPECTED_KEY_PATTERN`
    `static Pattern` | `UUID_PATTERN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `assertValidKey(String key)` Logs an warning when the key is not a valid key
    `static boolean` | `isValidKey(String key)` Returns true when the key is `null` or either a plain UUID or a key formatted as "f:[UUID]:any_string"

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### UUID_PATTERN

          public static final Pattern UUID_PATTERN

    - #### EXPECTED_KEY_PATTERN

          public static final Pattern EXPECTED_KEY_PATTERN

  - ### Constructor Detail

    - #### KeyUtils

          public KeyUtils()

  - ### Method Detail

    - #### isValidKey

          public static boolean isValidKey(String key)

      Returns true when the key is `null` or either a plain UUID or a key formatted as "f:[UUID]:any_string"
      Parameters:
        `key` - String representation of the key
      Returns:

    - #### assertValidKey

          public static void assertValidKey(String key)
                                     throws IllegalArgumentException

      Logs an warning when the key is not a valid key
      Parameters:
        `key` - String representation of the key
      Throws:
        `IllegalArgumentException`

Copyright © 2020 JBoss by Red Hat. All rights reserved.