Skip to main content

Module documents

Module documents 

Source
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§

DocumentSignature
One signature over a document’s payload bytes.
ParsedDocumentKind
A kind split back into the namespace that published it and the type it names.
SignedDocument
The signing envelope shared by every control document.

Enums§

DocumentType
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 kind discriminator.
PAYLOAD_ENCODING
The only payload encoding the format defines.
SIGNATURE_ALGORITHM
The only signature algorithm the format defines.

Functions§

document_kind
Returns the kind discriminator for one document type under a namespace.
parse_document_kind
Splits a kind back into its namespace and document type.