Rig.Connection.Codec (Reactive Interaction Gateway v3.0.0-alpha.2) View Source

Encode and decode a connection token, e.g., for correlation.

Link to this section Summary

Functions

Returns module configuration.

Decrypts ciphertext using key. Ciphertext is init. vector, ciphertag (MAC) and the actual ciphertext concatenated.

Convert a serialized string back into a pid.

Convert a serialized string back into a pid.

Encrypts value using key and returns init. vector, ciphertag (MAC) and ciphertext concatenated. Additional authenticated data (AAD) adds parameters like protocol version num. to MAC

The function processes any string or number and returns exactly 16 byte binary. The hash produced by this function can be used as key by both encrypt and decrypt functions.

Turn a pid into an url-encoded string.

Link to this section Functions

Specs

config() :: any()

Returns module configuration.

If application environment contains values in Keyword or Map struct, defaults from macro usage will be recursively merged with application configuration.

If one of the configuration parameters does not exist or can not be resolved, raises ArgumentError.

Link to this function

decrypt(ciphertext, key)

View Source

Specs

decrypt(binary(), binary()) :: binary()

Decrypts ciphertext using key. Ciphertext is init. vector, ciphertag (MAC) and the actual ciphertext concatenated.

Link to this function

deserialize(base64_encoded)

View Source

Specs

deserialize(binary()) :: {:ok, pid()} | {:error, :not_base64 | :invalid_term}

Convert a serialized string back into a pid.

Specs

deserialize!(binary()) :: pid()

Convert a serialized string back into a pid.

Specs

encrypt(binary(), binary()) :: binary()

Encrypts value using key and returns init. vector, ciphertag (MAC) and ciphertext concatenated. Additional authenticated data (AAD) adds parameters like protocol version num. to MAC

Specs

hash(binary()) :: binary()

The function processes any string or number and returns exactly 16 byte binary. The hash produced by this function can be used as key by both encrypt and decrypt functions.

Specs

serialize(pid()) :: binary()

Turn a pid into an url-encoded string.