Handkit.Profile.sign_data
You're seeing just the function
sign_data
, go back to Handkit.Profile module for more information.
Specs
sign_data(Handkit.Connect.t(), binary(), keyword()) :: {:ok, map()} | {:error, any()}
Signs the given data value with the currently authenticated user's identity key.
Options
format
- The data value format, must be one of"base64"
,"hex"
or"utf-8"
(default).
Example
iex> Handkit.Profile.sign_data(client, "Handkit")
{:ok, %{
"public_key" => "02f29085c38697e1014283cc80ee22fec356be2c7803bbad8c46f8d62000cb374e",
"signature" => "Hyy5LdDZxRy8M2Kfzz0/l9g9eywoO/Eo+B3epfP6V+12Fum+l4J5tPofq0Uo0j3B4it8nxGqYYAQBo/bvgGA5qk="
}}
iex> Handkit.Profile.sign_data(client, "SGFuZGtpdA==", format: "base64")
{:ok, %{
"public_key" => "02f29085c38697e1014283cc80ee22fec356be2c7803bbad8c46f8d62000cb374e",
"signature" => "Hyy5LdDZxRy8M2Kfzz0/l9g9eywoO/Eo+B3epfP6V+12Fum+l4J5tPofq0Uo0j3B4it8nxGqYYAQBo/bvgGA5qk="
}}