Low-level constructor. Prefer the static factories (Identity.generate,
Identity.fromPublicKey, Identity.fromBytes).
StaticTRUNCATED_The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsDecrypt information for the identity.
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Encrypt information for the identity.
Returns the application-specific metadata as a UTF-8 string.
Get the context for HKDF.
Get the raw private key bytes (64 bytes).
Get the public key as bytes.
Get the salt for HKDF.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionaloptions: boolean | EventListenerOptionsSets the application-specific metadata attached to announcements.
Signs information by the identity.
StaticfromLoad an identity from raw bytes.
StaticfromLoad an identity from a public key.
StaticfullGet a SHA-256 hash of passed data.
StaticgenerateCreate a new random identity.
StaticgetReturns 16 fresh random bytes (TRUNCATED_HASHLENGTH//8).
Mirrors RNS.Identity.get_random_hash(). Despite the name this is plain
randomness, not a hash of anything. It is the source of the random half
of the announce random_hash (SPEC.md §4.1) and the Resource random-hash
prefix (§10.2 step 3).
16 random bytes.
StaticloadAttempts to load an identity from a storage adapter, or generates and saves a new one.
OptionalstorageAdapter: any
Must implement async loadKey() and async saveKey(bytes)
StatictruncatedGet a truncated SHA-256 hash of passed data.
StaticvalidateValidates an announce exactly like RNS/Identity.py::validate_announce
(SPEC.md §4.5 steps 1-3).
Parses the announce body — branching on contextFlag so a ratchet-bearing
announce shifts the signature 32 bytes deeper (§4.5 step 1) — verifies the
Ed25519 signature over the §4.2 signed_data (step 2), and recomputes the
destination hash from (name_hash, public_key) to confirm it matches the
outer packet header (step 3).
The caller is responsible for the §4.5 step 4 public-key collision check
and step 6 caching, since those touch Destination.knownDestinations.
16-byte dest_hash from the outer packet header.
the packet header's context_flag bit (ratchet present).
the announce body (packet payload).
null on any validation failure.
Represents a Reticulum Identity.
Description
Identity creation, signing, and verification