Pow v1.0.20 Pow.Plug.MessageVerifier behaviour View Source
This module can sign and verify messages.
Based on Phoenix.Token
.
Link to this section Summary
Link to this section Functions
Link to this function
sign(conn, salt, message, config)
View Sourcesign(Plug.Conn.t(), binary(), binary(), keyword()) :: binary()
Signs a message.
Plug.Crypto.MessageVerifier.sign/2
is used. The secret is derived from the
salt
and conn.secret_key_base
using
Plug.Crypto.KeyGenerator.generate/3
. If :key_generator_opts
is set in the
config, this will be passed on to Plug.Crypto.KeyGenerator
.
Link to this function
verify(conn, salt, message, config)
View Sourceverify(Plug.Conn.t(), binary(), binary(), keyword()) :: {:ok, binary()} | :error
Verifies a message.
Plug.Crypto.MessageVerifier.sign/2
is used. The secret is derived from the
salt
and conn.secret_key_base
using
Plug.Crypto.KeyGenerator.generate/3
. If :key_generator_opts
is set in the
config, this will be passed on to Plug.Crypto.KeyGenerator
.
Link to this section Callbacks
Link to this callback
sign(arg1, binary, binary, keyword)
View Sourcesign(Plug.Conn.t(), binary(), binary(), keyword()) :: binary()
Link to this callback
verify(arg1, binary, binary, keyword)
View Sourceverify(Plug.Conn.t(), binary(), binary(), keyword()) :: {:ok, binary()} | :error