Class IdentifierWithHMAC

    • Constructor Detail

      • IdentifierWithHMAC

        public IdentifierWithHMAC​(byte[] value,
                                  SecretKey hmacKey)
        Creates a new identifier protected with a SHA-256 based HMAC.
        Parameters:
        value - The identifier value. Must not empty or null.
        hmacKey - The HMAC key. Must be at least 128 bits long.
      • IdentifierWithHMAC

        public IdentifierWithHMAC​(SecretKey hmacKey)
        Generates a new 128-bite secure random identifier and protects it with a SHA-256 based HMAC.
        Parameters:
        hmacKey - The HMAC key. Must be at least 128 bits long.
        Throws:
        RuntimeException - If HMAC computation failed.