# `Cryppo.EncryptedData`
[🔗](https://github.com/leikind/cryppo_ex/blob/main/lib/cryppo/encrypted_data.ex#L1)

A struct for encrypted data and encryption artefacts

An `Cryppo.EncryptedData` struct may be marked as belonging to a certain encryption strategy
using field `encryption_strategy_module` containing the module of the encryption strategy.

Can also contain encryption artefacts if they are part of the  encryption strategy.

# `t`

```elixir
@type t() :: %Cryppo.EncryptedData{
  encrypted_data: binary(),
  encryption_artefacts: Cryppo.EncryptionArtefacts.t(),
  encryption_strategy_module: Cryppo.encryption_strategy_module() | nil
}
```

Struct `Cryppo.EncryptedData`

A `Cryppo.EncryptedData` struct contains

* `encrypted_data`: encrypted data
* `encryption_strategy_module`: module of the encryption strategy to which the key belongs
* `encryption_artefacts`: a map with encryption artefacts

# `new`

```elixir
@spec new(
  Cryppo.encryption_strategy_module(),
  binary(),
  Cryppo.EncryptionArtefacts.t()
) :: t()
```

Initialize a struct with the module of an encryption strategy, a
binary with encrypted data, and encryption_artefacts.

---

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