Anoma.Crypto.Id (Anoma v0.25.0)

I represent the Identity

Summary

Functions

Grabs the external id of a given key

I salt the given keys for further storage. Or for storage lookup

I unsalt the given keys for use after looking up from storage

Types

Link to this type

identities()

@type identities() :: Anoma.Crypto.Id.Intern.t() | Anoma.Crypto.Id.Extern.t() | t()
@type t() :: %Anoma.Crypto.Id{
  external: Anoma.Crypto.Id.Extern.t() | nil,
  internal: Anoma.Crypto.Id.Intern.t() | nil,
  kind_encrypt: atom(),
  kind_sign: atom()
}

Functions

Link to this function

external_id(extern)

@spec external_id(t() | Anoma.Crypto.Id.Extern.t()) :: Anoma.Crypto.Id.Extern.t()

Grabs the external id of a given key

Useful when we want to use id and the external as interchangeable

@spec new_keypair() :: t()
Link to this function

salt_keys(id, sym)

@spec salt_keys(identities(), Anoma.Crypto.Symmetric.t()) :: identities()

I salt the given keys for further storage. Or for storage lookup

I can be used on t, Intern.t or Extern.t.

  • t is useful for salting for storage
  • Extern.t is useful for looking up keys for storage
  • Intern.t is useful in case one wants to see the salted key
Link to this function

seal(message, extern)

@spec seal(any(), Anoma.Crypto.Id.Extern.t()) :: binary()
Link to this function

truncated_key_string(key)

Link to this function

unsalt_keys(id, sym)

@spec unsalt_keys(identities(), Anoma.Crypto.Symmetric.t()) :: identities()

I unsalt the given keys for use after looking up from storage

I can be used on t, Intern.t or Extern.t.

  • t is useful for unsalting from Storage
  • Extern.t is useful for external keys which are salted
  • Intern.t is useful in case when one wants to unsalt their private keys
Link to this function

verify(message, extern)

@spec verify(binary(), Anoma.Crypto.Id.Extern.t()) ::
  {:error, :failed_verification} | {:ok, binary()}