Plug.Crypto.sign
You're seeing just the function
sign
, go back to Plug.Crypto module for more information.
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 toPlug.Crypto.KeyGenerator
when generating the encryption and signing keys. Defaults to 1000:key_length
- option passed toPlug.Crypto.KeyGenerator
when generating the encryption and signing keys. Defaults to 32:key_digest
- option passed toPlug.Crypto.KeyGenerator
when generating the encryption and signing keys. Defaults to:sha256
:signed_at
- set the timestamp of the token in seconds. Defaults toSystem.system_time(:second)
:max_age
- the default maximum age of the token. Defaults to86400
seconds (1 day) and it may be overridden onverify/4
.