BSV-ex v0.2.3 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

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

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

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