Skip to main content

Module signing

Module signing 

Source
Expand description

A paired device’s key, and the signature its send requests carry (agentmux-mobile’s SPEC_SEND_FROM_THE_PHONE_2026_10_13 §4, §5.2.1).

Sending makes the phone the operator for an agent, so the viewer token alone isn’t enough: a request also carries a signature by a key made in the phone’s hardware key store at pairing, which never leaves it. srv keeps the public half (db_viewer_devices.device_key) and checks:

amxv-sig-v1
<METHOD>
<path as sent, no query>
<X-Amxv-Timestamp, unix ms>
<lowercase hex SHA-256 of the body>

joined by \n. The phone’s key is ECDSA P-256 (the one curve Android’s Keystore and iOS’s Secure Enclave both hold in hardware), sent as the 65-byte uncompressed point, signing SHA-256 with a DER signature. A 32-byte key is Ed25519, the shape pairing accepted first; it verifies too.

Structs§

NonceLog
The nonces of signed opens seen lately, per device.

Enums§

DeviceKey
A device’s public key, parsed from its stored base64.

Constants§

MAX_NONCES
The most nonces remembered at once. Past it an open is refused rather than a nonce forgotten.
MAX_SKEW_MS
How far a request’s timestamp may be from srv’s clock, either way.
NONCE_HEADER
The header carrying the nonce of a signed open.
NONCE_MEMORY_MS
How long a nonce is remembered: longer than a timestamp stays fresh either way, so a replay is either stale or remembered.
OPEN_SIG_VERSION
The first line of the text a computer signs to open a feed (docs/specs/SPEC_REMOTE_PANES_WATCH_AND_DRIVE_AN_AGENT_ON_ANOTHER_COMPUTER_2026_11_20.md §3):
SIGNATURE_HEADER
The header carrying the signature, standard base64.
SIG_VERSION
The first line of the signed text; a new format gets a new tag.
TIMESTAMP_HEADER
The header carrying the signing time, unix ms.

Functions§

fresh
Whether a request signed at timestamp_ms is fresh at now_ms.
nonce_shape_ok
Whether nonce has the shape a nonce must: 16 to 128 characters of letters, digits, - and _.
open_signed_text
The text a computer’s feed open signs.
signed_text
The text a request’s signature covers.