# `Baobab.Identity`
[🔗](https://github.com/mwmiller/baobab_ex/blob/main/lib/baobab/identity.ex#L1)

Functions related too Baobab identity (keypair) handling

# `as_base62`

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

Resolve an identity to its Base62 representation

Attempts to resolve `~short` using stored logs

# `create`

```elixir
@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.

# `drop`

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

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

# `key`

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

Retrieve the key for a stored identity.

Can be either the `:public` or `:secret` key

# `list`

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

List all known identities with their base62 public key representation

# `rename`

```elixir
@spec rename(String.t(), String.t()) :: String.t() | {:error, String.t()}
```

Rename an extant identity leaving its keys intact.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
