Expand description
Mirror of the Scrollcase signed-document envelope.
Signed documents carry their payload as exact base64-encoded JSON rather than canonicalized JSON. That choice is what makes a third implementation possible at all: verifying a signature means hashing bytes that were transmitted verbatim, so Node, Python and this crate agree without each maintaining a canonical-JSON implementation — historically the richest source of cross-language signature bugs.
Decoding is deliberately separate from verifying. This module unwraps an envelope and proves the payload bytes are the ones the envelope names; it never decides that they are authentic. Nothing here reads a key, and the decoded bytes stay bytes: a caller that deserialises them before a signature has verified has skipped the only step that matters.
Structs§
- Document
Signature - One signature over a document’s payload bytes.
- Parsed
Document Kind - A
kindsplit back into the namespace that published it and the type it names. - Signed
Document - The signing envelope shared by every control document.
Enums§
- Document
Type - The three document types the format defines.
Constants§
- BOX_
SCHEMA_ VERSION - Format version carried by every document this contract describes.
- DEFAULT_
DOCUMENT_ NAMESPACE - Namespace prefixing every document’s
kinddiscriminator. - PAYLOAD_
ENCODING - The only payload encoding the format defines.
- SIGNATURE_
ALGORITHM - The only signature algorithm the format defines.
Functions§
- document_
kind - Returns the
kinddiscriminator for one document type under a namespace. - parse_
document_ kind - Splits a
kindback into its namespace and document type.