Repository navigation
Description
Name (2026-11-08): renamed from "local KAS" to owner KAS before anything shipped (arkavo-ios ADR-0070). Routes, audience, content type and the vault's HKDF info all use
owner-kas.
Revised (2026-11-08): the owner decided that "OpenTDFKit can hit either KAS (platform KAS or owner KAS)". The owner KAS now answers OpenTDF's standard Rewrap at its own KAS URL, so the asks below replace the earlier "exposed non-HTTP unwrap".
Why
arkavo-ios is adding an owner KAS on iPhone (arkavo-ios ADR-0070, ADR-0072, ADR-0073, Proposed). The owner's phone holds an EC P-256 KAS key and decides each release. An iPhone can't be reached directly, so its KAS URL is an address on platform.arkavo.net, https://platform.arkavo.net/owner-kas/v1/routes/<route_id>, where a relay queues requests until the phone answers. A receiver calls that URL with KASRewrapClient, exactly as it calls the platform KAS. The difference is that an owner can take up to 15 minutes to approve.
Today OpenTDFKit has KAS-side rewrap (KASService.rewrapKeyInternal) only for NanoTDF v12. Its client expects a 200 within 30 s, signs the request token with a fixed 60 s exp, and matches KAOs by scheme, host and port only.
Design and contract (§4.4–§4.6): https://github.com/arkavo-org/arkavo-ios/blob/7d11e02/docs/superpowers/specs/2026-11-08-owner-kas-design.md
Ask: KAS side (used on the owner's phone)
- Standard-TDF EC rewrap. A public, pure API (no network, no storage). Input: the KAS P-256 private key as a value, an
ec-wrappedKAO and its policy, and the request'sclientPublicKey. It verifies the policy binding, unwraps the DEK and rewraps it toclientPublicKey. It returns the standard result'skasWrappedKeyandsessionPublicKey(ECDH, HKDF-SHA-256 with the go SDK TDF salt, AES-256-GCM). - Parse and verify a received Rewrap. Given the body
{"signed_request_token": …}and a P-256 public key, verify the ES256 JWT under that key and return itsexp, the decodedrequestBody(clientPublicKey, the policy, the KAOs) and any extension member (below). - Build a Rewrap response body, so the phone can return
{sessionPublicKey, responses:[{policyId, results:[{keyAccessObjectId, status, kasWrappedKey, error, metadata}]}]}with caller-suppliedmetadata.
Ask: client side (KASRewrapClient, used by the receiver)
- Pending answers. On
202withLocationandRetry-After, pollGET Locationwith the same bearer, honoringRetry-After, until200(the normal Rewrap response),410(expired) or a caller-supplied deadline. Return expired distinctly from a denial. - Request-token lifetime. Let the caller set the signed request token's
exp. The owner KAS needs it equal to the bearer token'sexp, not 60 s. - Path-aware KAO matching. When the configured KAS URL has a path, match a KAO's
urlon scheme, host, port and path. The platform KAS and owner KASs share platform.arkavo.net. - An extension member in
requestBody. Let the caller add one top-level member (arkavo-ios uses"arkavo": {v, attempt_id, nonce, tdf_digest}), covered by the request signature. A KAS that doesn't know it ignores it. - Return what the KAS sent. Alongside the unwrapped key (or share), return each result's
metadata, itskasWrappedKey, thesessionPublicKeyand the signed request token's digest. The receiver verifies the owner's signed decision inmetadata["arkavo.decision"]before it decrypts anything.
Also
- Encrypt with an
ec-wrappedKAO. Confirm (or add) that the TDF builder can wrap to a caller-supplied P-256 KAS public key with a caller-supplied KAO URL and policy. - A tagged release. arkavo-ios pins exact tags (ADR-0026).
Tests
- Round trip: build → KAS rewrap → client unwrap gives the same DEK; another client key fails; a tampered policy fails the binding check before any rewrap.
- A Rewrap whose JWT is signed by another key, or whose body was changed after signing, fails verification.
- The client polls a 202 → 202 → 200 sequence with
Retry-After, stops at its deadline, and reports 410 as expired. - With the platform KAS and an owner KAS both on one host, each client selects only its own KAO.
Tracking epic: https://github.com/arkavo-org/arkavo-ios/issues/77
Activity
fix(kas): close review minors on the ec-wrapped path (#66)
ci: ec-wrapped interop job and xtest tdf-ecwrap (#66)
[-]KAS-side standard-TDF EC rewrap for an on-device KAS, and an exposed client unwrap[/-][+]Owner KAS: KAS-side standard-TDF EC rewrap, and Rewrap client support for a KAS that answers later (202 polling, request-token lifetime, path-aware KAO matching, extension, metadata)[/+]docs: design and plan for owner-KAS rewrap (#66)
feat(kas): shared request, KAO and key digests (#66)
fix(kas): match key access objects by path too (#66)
feat(kas): verify a received Rewrap on the owner KAS (#66)
feat(kas): build a Rewrap response on the owner KAS (#66)
feat(kas): prepare a signed Rewrap with caller exp and extension (#66)
feat(kas): poll a KAS that answers later; return full Rewrap results (#…
test(kas): owner-KAS end to end; docs (#66)
fix(kas): strict JWS and JSON checks on the owner KAS (#66)
fix(kas): harden the pending Rewrap client and matching (#66)
fix(kas): close Gitar findings on the owner-KAS path (#66)
Merge pull request #68 from arkavo-org/feat/66-kas-side-ec-rewrap
arkavo-com commentedon Nov 9, 2026
Done in #68 and released as 5.2.0 (tag 5.2.0 → 3f9f0f3). Items 1–9 are in the PR; item 10 is the tag.