View Source Eddy.PubKey (Eddy v1.0.0)

Module for working with public keys.

PubKey structs can be encoded to and from binary data, using any encoding.

Link to this section Summary

Types

t()

Public Key

Functions

Converts the given binary data to a PubKey struct, optionally with the specified encoding.

Converts the given PubKey struct to a binary, optionally with the specified encoding.

Link to this section Types

@type t() :: %Eddy.PubKey{point: Eddy.Point.t()}

Public Key

An EdDSA public key consists of a Point (x and y co-ordinates on an elliptic curve), derived from its corresponding private key.

Link to this section Functions

Link to this function

from_bin(data, encoding \\ nil)

View Source
@spec from_bin(binary(), Eddy.encoding() | nil) :: {:ok, t()} | {:error, term()}

Converts the given binary data to a PubKey struct, optionally with the specified encoding.

Returns the result in an :ok / :error tuple pair.

Link to this function

to_bin(pub_key, encoding \\ nil)

View Source
@spec to_bin(t(), Eddy.encoding() | nil) :: binary()

Converts the given PubKey struct to a binary, optionally with the specified encoding.