View Source Baobab.Identity (Baobab v0.30.0)

Functions related too Baobab identity (keypair) handling

Summary

Functions

Resolve an identity to its Base62 representation

Create and store a new identity string

Drop a stored identity. Baobab will be unable to recover keys (notably :secret keys) destroyed herewith.

Retrieve the key for a stored identity.

List all known identities with their base62 public key representation

Rename an extant identity leaving its keys intact.

Functions

@spec as_base62(String.t()) :: String.t() | {:error, String.t()}

Resolve an identity to its Base62 representation

Attempts to resolve ~short using stored logs

Link to this function

create(identity, secret_key \\ nil)

View Source
@spec create(String.t(), binary() | nil) :: String.t() | {:error, String.t()}

Create and store a new identity string

An optional secret key to be associated with the identity may provided, either raw or base62 encoded. The public key will be derived therefrom.

@spec drop(String.t()) :: :ok | {:error, String.t()}

Drop a stored identity. Baobab will be unable to recover keys (notably :secret keys) destroyed herewith.

@spec key(String.t(), atom()) :: binary() | :error

Retrieve the key for a stored identity.

Can be either the :public or :secret key

@spec list() :: [{String.t(), String.t()}]

List all known identities with their base62 public key representation

Link to this function

rename(identity, new_name)

View Source
@spec rename(String.t(), String.t()) :: String.t() | {:error, String.t()}

Rename an extant identity leaving its keys intact.