Envelope Format

json‑seal produces a portable, self‑verifying JSON envelope. Each sealed document contains the payload, a timestamp, and an RSA‑PSS signature with the embedded public key required for verification. The payload is canonicalized using the RFC 8785 JSON Canonicalization Scheme and signed using RSA‑PSS with SHA‑256.

Structure

The sealed envelope has the following shape:

{
  "version": 1,
  "timestamp": "2026-01-11T18:24:55.402Z",

  "payload": {
    "id": 1,
    "message": "hello"
  },

  "signature": {
    "algorithm": "RSA-PSS-SHA256",
    "publicKey": "-----BEGIN PUBLIC KEY----- ...",
    "value": "base64-signature"
  }
}

Fields

version

Identifies the envelope format version. This changes only if the envelope structure or canonicalization rules evolve.

timestamp

ISO‑8601 timestamp indicating when the envelope was sealed.

payload

The original JavaScript value provided to signPayload(). It is canonicalized using RFC 8785 before signing.

signature

Contains the RSA‑PSS signature over the canonicalized payload. SHA‑256 hashing is performed internally by the RSA‑PSS algorithm. The canonical form and digest are not stored; they are derived during sealing and verification.

Stability

← Back