BSV-ex v0.2.2 BSV.Crypto.ECDSA.PublicKey View Source

ECDSA Private Key module.

Link to this section Summary

Types

Erlang ECDSA Public Key sequence

t()

ECDSA Public Key

Functions

Converts the given ECDSA public key struct to an Erlang EC point sequence.

Converts the given public key into a compressed binary

Link to this section Types

Link to this type

point()

View Source
point() :: {:ECPoint, binary()}

Erlang ECDSA Public Key sequence

Link to this type

t()

View Source
t() :: %BSV.Crypto.ECDSA.PublicKey{point: binary()}

ECDSA Public Key

Link to this section Functions

Link to this function

as_sequence(public_key)

View Source
as_sequence(BSV.Crypto.ECDSA.PublicKey.t()) :: BSV.Crypto.ECDSA.Key.sequence()

Converts the given ECDSA public key struct to an Erlang EC point sequence.

Examples

iex> public_key = BSV.Crypto.ECDSA.PrivateKey.from_sequence(BSV.Test.ecdsa_key)
...> |> BSV.Crypto.ECDSA.PrivateKey.get_public_key
...>
...> BSV.Crypto.ECDSA.PublicKey.as_sequence(public_key)
...> |> is_tuple
true

Converts the given public key into a compressed binary

Examples

iex> public_key = BSV.Crypto.ECDSA.PrivateKey.from_sequence(BSV.Test.ecdsa_key)
...> |> BSV.Crypto.ECDSA.PrivateKey.get_public_key
...>
...> BSV.Crypto.ECDSA.PublicKey.compress(public_key)
...> |> byte_size
33