# `Oasis.Token.Crypto`
[🔗](https://github.com/xinz/oasis/blob/main/lib/oasis/token.ex#L28)

A module to represent crypto-related key information.

All fields of `Oasis.Token.Crypto` are completely map to:

* `Plug.Crypto.encrypt/4` and `Plug.Crypto.decrypt/4`
* `Plug.Crypto.sign/4` and `Plug.Crypto.verify/4`

Please refer the above functions for details to construct it.

In general, when we define a bearer security scheme of the OpenAPI Specification,
the generated module will use this struct to define the required crypto-related
key information.

Please note that the value of the `:secret_key_base` field is required to be a string at least 20 length.

# `t`

```elixir
@type t() :: %Oasis.Token.Crypto{
  key_digest: atom(),
  key_iterations: pos_integer(),
  key_length: pos_integer(),
  max_age: integer(),
  salt: String.t(),
  secret: String.t(),
  secret_key_base: String.t(),
  signed_at: non_neg_integer()
}
```

---

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