pbcs v0.1.0 PBCS.KeyManager behaviour 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

Link to this type t() View Source
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
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
encrypt(
  params :: any(),
  protected :: map(),
  content_encryptor :: PBCS.ContentEncryptor.t()
) :: {:ok, map(), binary(), binary()} | {:error, String.t()}
Link to this callback init(protected, opts) View Source
init(protected :: map(), opts :: Keyword.t()) ::
  {:ok, any()} | {:error, String.t()}