rezn-jcsd is a fast, dependency-free UNIX socket daemon for canonicalizing JSON according to RFC 8785 (JCS).
https://discuss.ocaml.org/t/canonical-json-with-yojson-for-signature-verification/16725/16
- Canonicalizes JSON via UNIX socket or CLI
- Vendored Go implementation (Apache 2.0)
- C++ implementation based on the Go implementation - suitable for FFI
- Suitable for cryptographic signing pipelines
- Minimal, auditable, production-ready
Launch the service (creating socket file in /tmp for quick testing)
REZN_JCSD_SOCKET=/tmp/jcsd.sock ./jcsdHit it with some JSON
echo '{"op":"canon","source":"{ \"b\":2, \"a\":1 }"}' | socat - UNIX-CONNECT:/tmp/jcsd.sockReturns:
{"result":"{\"a\":1,\"b\":2}"}cat input.json | reznjcs-cli > canonical.jsonREZN_JCSD_SOCKET: override default socket path (/run/rezn-jcsd/jcs.sock)
go build -o reznjcs-cli ./cmd/cli
go build -o jcsd ./cmd/jcsdSee the corresponding readme
-
rezn-jcsdis licensed under MIT -
Canonicalization logic is vendored from Anders Rundgren's json-canonicalization library, originally published under the Apache License 2.0