Plug.Crypto.sign

You're seeing just the function sign, go back to Plug.Crypto module for more information.
Link to this function

sign(key_base, salt, data, opts \\ [])

View Source

Encodes and signs data into a token you can send to clients.

Plug.Crypto.sign(conn.secret_key_base, "user-secret", {:elixir, :terms})

Options

  • :key_iterations - option passed to Plug.Crypto.KeyGenerator when generating the encryption and signing keys. Defaults to 1000
  • :key_length - option passed to Plug.Crypto.KeyGenerator when generating the encryption and signing keys. Defaults to 32
  • :key_digest - option passed to Plug.Crypto.KeyGenerator when generating the encryption and signing keys. Defaults to :sha256
  • :signed_at - set the timestamp of the token in seconds. Defaults to System.system_time(:second)
  • :max_age - the default maximum age of the token. Defaults to 86400 seconds (1 day) and it may be overridden on verify/4.