Class KeyValidator

java.lang.Object
io.github.fherbreteau.vodozemac.KeyValidator

public final class KeyValidator extends Object
Utility for validating encryption keys used by the vodozemac pickle format.

vodozemac encrypted pickles require a 256-bit (32-byte) key. This class centralises that validation to avoid duplication across the classes that support encrypted pickling (Account, OlmSession, OutboundGroupSession, InboundGroupSession, etc.).

Author:
François HERBRETEAU
  • Method Details

    • validateEncryptionKey

      public static void validateEncryptionKey(byte[] key)
      Validates that the given key is exactly 256-bit (32-byte), as required by the vodozemac encrypted pickle format.
      Parameters:
      key - the key to validate
      Throws:
      KeyException - if the key is not 32 bytes long