nx_jwk.nx
buildroot/runtime/nx_jwk.nx
about
nx_jwk.nx -- JSON Web Key serialization (RFC 7517 + RFC 8037).
Closes the JWK gap for ACME (RFC 8555). An ACME account is
identified by its public-key JWK; ACME server uses
SHA-256(canonical-JWK) as the account-thumbprint.
Per cardinal feedback-no-third-party-trust-native-or-nothing:
substrate ships its own JWK encoder; no openssl-jose dep.
Supported key types (today):
OKP / Ed25519 (RFC 8037 §2) -- composes with shipped
nx_ed25519_signature
Queued (separate slices when needed):
EC / P-256 (RFC 7518 §6.2) -- needs nx_p256
RSA / 2048+ (RFC 7518 §6.3) -- needs nx_rsa
JWK shape (OKP/Ed25519 public):
{ "kty": "OKP", "crv": "Ed25519", "x": "<b64url(32B pubkey)>" }
Canonical (RFC 7638) thumbprint input:
the same JSON with members in lexicographic order, no whitespace
between tokens. Substrate emits canonical form by default.
nx_capability_claims:
needs: [sealed_enum, b64url, json_emit]
provides: [jwk_okp_ed25519_emit, jwk_thumbprint_input]
safety: [no_unchecked_deref, no_floating_point, no_syscall_other_than_mmap,
bit_equal_reproducible, target_agnostic]
verdict: [sealed_enum_5_state]
license: ORIGINAL
kind: racing_crew_specialist
layer: L3 (algorithm: encode key per RFC)
dependencies 2 imports · 2 importers
imports: nx_syscalls_x86_64.nxnx_jwt.nx
imported by: nx_acme.nxnx_jose_test.nx
structs
| none |
consts
| 40 | const NXJWK_OK: i64 = 0 |
| 41 | const NXJWK_OOM_BUFFER: i64 = 1 |
| 42 | const NXJWK_BAD_KEY_LEN: i64 = 2 |
| 43 | const NXJWK_BAD_KTY: i64 = 3 |
| 44 | const NXJWK_BAD_ARG: i64 = 4 |
| 45 | const NXJWK_VERDICT_N: i64 = 5 |
functions
| 47 | func nxjwk_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 53 | func nxjwk_verdict_name(v: i64) -> *u8 called by 1: main |
| 64 | func nxjwk_put(out: *u8, off: *i64, cap: i64, b: i64) -> i64 |
| 71 | func nxjwk_put_cstr(out: *u8, off: *i64, cap: i64, s: *u8) -> i64 |
| 81 | func nxjwk_put_bytes(out: *u8, off: *i64, cap: i64, src: *u8, n: i64) -> i64 |
| 102 | func nx_jwk_emit_okp_ed25519(out: *u8, off: *i64, cap: i64, |
| 135 | func nx_jwk_thumbprint_input_okp(out: *u8, off: *i64, cap: i64, calls 1: nx_jwk_emit_okp_ed25519 |