View Source Stellar.KeyPair.Spec behaviour (Elixir Stellar SDK v0.22.0)

Defines contracts to generate, validate and encode/decode Stellar KeyPairs.

This behaviour allows you to use any crypto package of your choice. The default is Ed25519.

Summary

Types

@type contract() :: String.t()
@type error() :: {:error, atom()}
@type public_key() :: String.t()
@type secret_seed() :: String.t()
@type validation() :: :ok | error()

Callbacks

Link to this callback

from_raw_muxed_account(binary)

View Source (optional)
@callback from_raw_muxed_account(binary()) :: public_key()
Link to this callback

from_raw_public_key(binary)

View Source (optional)
@callback from_raw_public_key(binary()) :: public_key()
Link to this callback

from_secret_seed(secret_seed)

View Source
@callback from_secret_seed(secret_seed()) :: {public_key(), secret_seed()}
@callback random() :: {public_key(), secret_seed()}
@callback raw_contract(contract()) :: binary()
Link to this callback

raw_muxed_account(public_key)

View Source
@callback raw_muxed_account(public_key()) :: binary()
Link to this callback

raw_pre_auth_tx(public_key)

View Source
@callback raw_pre_auth_tx(public_key()) :: binary()
Link to this callback

raw_public_key(public_key)

View Source
@callback raw_public_key(public_key()) :: binary()
Link to this callback

raw_secret_seed(public_key)

View Source
@callback raw_secret_seed(public_key()) :: binary()
Link to this callback

raw_sha256_hash(public_key)

View Source
@callback raw_sha256_hash(public_key()) :: binary()
Link to this callback

raw_signed_payload(public_key)

View Source
@callback raw_signed_payload(public_key()) :: binary()
Link to this callback

sign(binary, secret_seed)

View Source
@callback sign(binary(), secret_seed()) :: binary() | error()
Link to this callback

signature_hint_for_signed_payload(binary, binary)

View Source
@callback signature_hint_for_signed_payload(binary(), binary()) :: binary()
Link to this callback

valid_signature?(binary, binary, public_key)

View Source
@callback valid_signature?(binary(), binary(), public_key()) :: boolean()
Link to this callback

validate_contract(contract)

View Source
@callback validate_contract(contract()) :: validation()
Link to this callback

validate_muxed_account(public_key)

View Source (optional)
@callback validate_muxed_account(public_key()) :: validation()
Link to this callback

validate_pre_auth_tx(public_key)

View Source (optional)
@callback validate_pre_auth_tx(public_key()) :: validation()
Link to this callback

validate_public_key(public_key)

View Source (optional)
@callback validate_public_key(public_key()) :: validation()
Link to this callback

validate_secret_seed(public_key)

View Source (optional)
@callback validate_secret_seed(public_key()) :: validation()
Link to this callback

validate_sha256_hash(public_key)

View Source (optional)
@callback validate_sha256_hash(public_key()) :: validation()
Link to this callback

validate_signed_payload(public_key)

View Source (optional)
@callback validate_signed_payload(public_key()) :: validation()