PBCS.KeyManager behaviour (pbcs v0.1.2) View Source

Callback module for key managers.

Implement this behaviour if you want to implement your own key manager.

Link to this section Summary

Link to this section Types

Specs

t() :: %PBCS.KeyManager{module: module(), params: any()}

Link to this section Callbacks

Link to this callback

decrypt(params, protected, encrypted_key, content_encryptor)

View Source

Specs

decrypt(
  params :: any(),
  protected :: map(),
  encrypted_key :: binary(),
  content_encryptor :: PBCS.ContentEncryptor.t()
) :: {:ok, binary()} | {:error, String.t()}
Link to this callback

encrypt(params, protected, content_encryptor)

View Source

Specs

encrypt(
  params :: any(),
  protected :: map(),
  content_encryptor :: PBCS.ContentEncryptor.t()
) :: {:ok, map(), binary(), binary()} | {:error, String.t()}

Specs

init(protected :: map(), opts :: Keyword.t()) ::
  {:ok, any()} | {:error, String.t()}