BSV-ex v0.3.0 BSV.Crypto.ECDSA.PrivateKey View Source

ECDSA Private Key module.

Link to this section Summary

Types

Erlang ECDSA Private Key sequence

t()

ECDSA Private Key

Functions

Converts the given ECDSA private key to an Erlang ECDSA key sequence. Convert a BSV.Crypto.ECDSA.PrivateKey.t/0 to a BSV.Crypto.ECDSA.PrivateKey.sequence/0.

Converts the given Erlang ECDSA key sequence to a ECDSA private key.

Returns the public key from the given ECDSA private key.

Link to this section Types

Link to this type

sequence()

View Source
sequence() :: {:ECPrivateKey, integer(), binary(), tuple(), binary()}

Erlang ECDSA Private Key sequence

Link to this type

t()

View Source
t() :: %BSV.Crypto.ECDSA.PrivateKey{
  parameters: tuple(),
  private_key: binary(),
  public_key: binary(),
  version: integer()
}

ECDSA Private Key

Link to this section Functions

Link to this function

as_sequence(ecdsa_key)

View Source
as_sequence(t()) :: sequence()

Converts the given ECDSA private key to an Erlang ECDSA key sequence. Convert a BSV.Crypto.ECDSA.PrivateKey.t/0 to a BSV.Crypto.ECDSA.PrivateKey.sequence/0.

Examples

iex> ecdsa_key = BSV.Crypto.ECDSA.PrivateKey.from_sequence(BSV.Test.ecdsa_key)
...>
...> BSV.Crypto.ECDSA.PrivateKey.as_sequence(ecdsa_key)
...> |> is_tuple
true
Link to this function

from_sequence(ecdsa_key_sequence)

View Source
from_sequence(BSV.Crypto.ECDSA.sequence()) :: t()

Converts the given Erlang ECDSA key sequence to a ECDSA private key.

Examples

iex> ecdsa_key = BSV.Crypto.ECDSA.PrivateKey.from_sequence(BSV.Test.ecdsa_key)
...> ecdsa_key.__struct__ == BSV.Crypto.ECDSA.PrivateKey
true
Link to this function

get_public_key(ecdsa_key)

View Source
get_public_key(t()) :: BSV.Crypto.ECDSA.PublicKey.t()

Returns the public key from the given ECDSA private key.

Examples

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