Skip to content
instance method

OpenSSL::Cipher#auth_data=

(::String) -> ::String
cipher.auth_data = string

Sets additional authenticated data (AAD), also called associated data, for this Cipher. This method is available for AEAD ciphers.

The contents of this field should be non-sensitive data which will be added to the ciphertext to generate the authentication tag which validates the contents of the ciphertext.

This method must be called after key= and iv= have been set, but before starting actual encryption or decryption with update. In some cipher modes, auth_tag_len= and ccm_data_len= may also need to be called before this method.

See also the “AEAD Interface” section of the man page EVP_EncryptInit(3). This method internally calls EVP_CipherUpdate() with the output buffer set to NULL.

See also .new #authenticated? .ciphers #auth_tag also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0