# `Obscura.Vault`
[🔗](https://github.com/hfiguera/obscura/blob/v0.2.0/lib/obscura/vault.ex#L1)

Facade for reversible pseudonymization vault backends.

# `vault_ref`

```elixir
@type vault_ref() :: GenServer.server()
```

# `clear`

```elixir
@spec clear(
  vault_ref() | nil,
  keyword()
) :: :ok | {:error, term()}
```

Clears all mappings from a vault.

# `get_or_create`

```elixir
@spec get_or_create(vault_ref() | nil, atom(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Gets or creates a token for an entity/value pair.

# `info`

```elixir
@spec info(vault_ref() | nil) :: {:ok, map()} | {:error, term()}
```

Returns backend metadata for a vault.

# `lookup_token`

```elixir
@spec lookup_token(vault_ref() | nil, String.t(), keyword()) ::
  {:ok, Obscura.Vault.Entry.t()} | {:error, term()}
```

Looks up an entry by token.

# `lookup_value`

```elixir
@spec lookup_value(vault_ref() | nil, atom(), String.t(), keyword()) ::
  {:ok, Obscura.Vault.Entry.t()} | {:error, term()}
```

Looks up an entry by entity and original value.

# `rehydrate`

```elixir
@spec rehydrate(vault_ref() | nil, String.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

Rehydrates all known tokens in a string through a vault.

---

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