Class KeyMaterialUtils

java.lang.Object
com.kingsrook.qqq.backend.core.crypto.KeyMaterialUtils

public class KeyMaterialUtils extends Object
Shared key handling: validating key ids and decoding base64 key text. Used by the key providers and by RefreshTokenCipher. Messages name the setting, never the key.
  • Field Details

    • AES_256_KEY_LENGTH_BYTES

      public static final int AES_256_KEY_LENGTH_BYTES
      See Also:
  • Method Details

    • validateKeyId

      public static void validateKeyId(String keyId, String settingName) throws QException
      Make sure a key id (or version) can be embedded in a stored format.
      Throws:
      QException
    • decodeBase64Key

      public static byte[] decodeBase64Key(String base64Key, String settingName, int expectedLengthBytes) throws QException
      Decode base64 key text, requiring the given length in bytes.
      Throws:
      QException