Skip to main content

Crate openszigno_author

Crate openszigno_author 

Source
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 DossierSpec always 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 an Encryption renders different bytes on every run by design.
  • Readability by the reader. Every bound Limits places on a dossier is checked while building, and every document title is checked against the rules openszigno extract applies 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§

BuiltDocument
One document as it was written.
BuiltDossier
A finished dossier: the bytes to write, and what went into them.
DocumentSpec
One document to place in a dossier.
DossierSpec
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§

ErrorCode
Stable machine-readable categories returned by the author library.
KeyTransport
How the content-encryption key is wrapped for each recipient.
TitleRejection
Why a title cannot be used as a filename.

Constants§

DOCUMENT_CATEGORY
The E-category every document in it declares.
DOSSIER_CATEGORY
The E-category a 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-core recognises, 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, within limits.
check_title
Check one document title against the extraction naming rules.
declarable_extension
The extension the dossier may declare for title.