Expand description
Deterministic authoring of Microsec e-Szignó dossiers.
This crate is the writer side of openSzigno. It builds an unsigned
es:Dossier in the default e-Szignó 3.0 namespace, in the shape
openszigno_core parses, and sign adds the two things that can be
written into one afterwards: a signature, and a container es:TimeStamp.
It reads no file, opens no socket and consults no clock, and it verifies
nothing whatever: a dossier it produces is not evidence of anything.
The one exception is the encrypt transform: when a DossierSpec
names recipients, a document’s payload is written as a CMS
EnvelopedData addressed to them, which is what
openszigno extract --decrypt-key reads back. Encrypting says who can
read a document and nothing about who wrote it.
Two properties are load-bearing:
- Determinism. The same
DossierSpecalways renders the same bytes, unless it asks for encryption. Element order, indentation, and identifiers are fixed, the identifiers are positional (obj0,profile0, …), and the creation date comes from the caller. A content key, an initialisation vector, and key-transport padding must be unpredictable, so a spec carrying anEncryptionrenders different bytes on every run by design. - Readability by the reader. Every bound
Limitsplaces on a dossier is checked while building, and every document title is checked against the rulesopenszigno extractapplies before it writes a file, so a dossier this crate returns is one the rest of the tool can list, decode, and extract.
Modules§
- sign
- Signing a dossier: enveloped XMLDSig with the XAdES signed properties the e-dossier reference-scope rules require.
Structs§
- Built
Document - One document as it was written.
- Built
Dossier - A finished dossier: the bytes to write, and what went into them.
- Document
Spec - One document to place in a dossier.
- Dossier
Spec - The dossier to build.
- Encryption
- Who a document is encrypted for, and how their key is wrapped.
- Error
- One refused build. The message names a document by index only: a title, a path, and payload content never appear in it.
- Recipient
- One certificate a document may be encrypted for.
Enums§
- Error
Code - Stable machine-readable categories returned by the author library.
- KeyTransport
- How the content-encryption key is wrapped for each recipient.
- Title
Rejection - Why a title cannot be used as a filename.
Constants§
- DOCUMENT_
CATEGORY - The
E-categoryevery document in it declares. - DOSSIER_
CATEGORY - The
E-categorya dossier this crate writes declares. - NESTED_
DOSSIER_ EXTENSION - The extension an embedded dossier is titled with.
- NESTED_
DOSSIER_ MEDIA_ TYPE - The media type the nested-dossier detection in
openszigno-corerecognises, with the extension the same detection accepts. - NESTED_
DOSSIER_ SUBTYPE - The subtype half of
NESTED_DOSSIER_MEDIA_TYPE.
Functions§
- build
- Build a dossier from
spec, withinlimits. - check_
title - Check one document title against the extraction naming rules.
- declarable_
extension - The extension the dossier may declare for
title.