CryppoEx v0.1.4 Cryppo.EncryptionKey View Source

A struct to wrap an encryption key

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

Depending on the encryption strategy the key can be a binary or a tuple.

Keys must be guarded and protected, that is why the Inspect protocol has been overridden for this struct to disable pretty-printing.

Should you need to access the key, access it via field key.

Link to this section Summary

Types

A binary key

Encryption key

t()

Struct EncryptionKey

Functions

Initialize a struct with an encryption key

Initialize a struct with an encryption key and the module of an encryption strategy

Link to this section Types

Specs

binary_key() :: binary()

A binary key

Specs

internal_key() :: binary_key() | tuple()

Encryption key

An encryption key may me a tuple or a binary depending on the encryption strategy

Specs

t() :: %Cryppo.EncryptionKey{
  encryption_strategy_module: Cryppo.encryption_strategy_module(),
  key: internal_key()
}

Struct EncryptionKey

A Cryppo.EncryptionKey struct contains

  • key: the key itself
  • encryption_strategy_module: module of the encryption strategy to which the key belongs

Link to this section Functions

Specs

new(internal_key()) :: t()

Initialize a struct with an encryption key

Specs

Initialize a struct with an encryption key and the module of an encryption strategy