Anoma.Crypto.Id (Anoma v0.34.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
@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
@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()
@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 storageExtern.t
is useful for looking up keys for storageIntern.t
is useful in case one wants to see the salted key
@spec seal(any(), Anoma.Crypto.Id.Extern.t()) :: binary()
@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 StorageExtern.t
is useful for external keys which are saltedIntern.t
is useful in case when one wants to unsalt their private keys
@spec verify(binary(), Anoma.Crypto.Id.Extern.t()) :: {:error, :failed_verification} | {:ok, binary()}