Internal trusted key equivalence, redacted from default inspection.
Public identities use validated RequestSeal.PublicKey components, with
:rsa_pss normalized to :rsa. Symmetric identities are opaque, nonsecret
custodian-supplied binaries of 1–256 bytes. RequestSeal never derives one from
a secret. A caller must supply the same identity for aliases within its trusted
scope. Unknown equivalence never establishes equality, including with itself.
Do not place these internal values in general results, logs, or telemetry.
Summary
Functions
Compare known, validated identities; unknown or malformed identities never match.
Types
@type t() :: %RequestSeal.KeyIdentity{ kind: :public | :symmetric | :unknown, value: term() }
Functions
Compare known, validated identities; unknown or malformed identities never match.
Parameters
a,b-t/0values, normally returned byRequestSeal.Custody.identity/1.
Returns
true- both are:publicidentities whose components validate asRequestSeal.PublicKeymaterial and are equal after:rsa_pssis normalized to:rsa, or both are:symmetricidentities with equal binary values of 1–256 bytes.false- in every other case, including any:unknownidentity (even compared with itself), identities of different kinds, and malformed values. This function returns no error and does not raise.
Examples
iex> {public, _seed} = :crypto.generate_key(:eddsa, :ed25519)
iex> a = %RequestSeal.KeyIdentity{kind: :public, value: {:ed25519, public}}
iex> RequestSeal.KeyIdentity.same?(a, %RequestSeal.KeyIdentity{kind: :public, value: {:ed25519, public}})
true
iex> {other, _seed} = :crypto.generate_key(:eddsa, :ed25519)
iex> RequestSeal.KeyIdentity.same?(a, %RequestSeal.KeyIdentity{kind: :public, value: {:ed25519, other}})
false
iex> unknown = %RequestSeal.KeyIdentity{kind: :unknown, value: nil}
iex> RequestSeal.KeyIdentity.same?(unknown, unknown)
false