Skip to main content

Crate openszigno_core

Crate openszigno_core 

Source
Expand description

Structural parsing and bounded payload decoding for Microsec e-Szignó dossiers.

This crate does not perform XMLDSig or XAdES verification. A successfully parsed dossier is not necessarily authentic.

Re-exports§

pub use roxmltree;

Structs§

DecodedDocument
DecryptOptions
How decode_document_with may treat an encrypted document.
Document
Dossier
EncodingDeclaration
The encoding pseudo-attribute of an XML declaration, and where its value sits in the bytes it was read from.
Error
Limits
Resource limits applied while parsing and decoding a dossier.
MimeType
ParseOptions
How a dossier is parsed: the resource limits and the namespaces whose Dossier root element is accepted.
RecipientKey
The recipient private key extract decrypts with, together with the certificate that lets a RecipientInfo be recognised as naming it.
SignatureEvidence
How many evidence elements one signature carries. These are element counts only: nothing inside a certificate, CRL, OCSP response, or timestamp token is decoded, and carrying evidence says nothing about whether it is valid or even parsable.
SignatureSummary
One ds:Signature, as the XML claims it.
StructuralWarning
One non-fatal structural finding. The message never contains a title, a path, or payload content.
TimestampSummary
One container es:TimeStamp, as the XML claims it. Unverified, like every other part of the inventory.
XmlSource
Decoded, pre-scanned dossier text, ready to be parsed into a tree.

Enums§

DecodeOutcome
DetectedType
Coarse content category of a decoded payload.
ErrorCode
Stable machine-readable categories returned by the core library.
SignaturePlacement
Where a ds:Signature sits in the dossier.
StructuralWarningCode
Stable machine-readable categories of non-fatal structural findings.
TimestampPlacement
Where an es:TimeStamp sits in the dossier.
UnsupportedReason
Why a document that parsed could not be turned back into its source bytes.

Constants§

ESZIGNO_NAMESPACE
KNOWN_COMPATIBLE_NAMESPACES
Namespaces whose Dossier root element this crate accepts by default.
MAX_DISPLAY_CHARS
The cap used where a caller has no reason to pick its own: long enough for a credential identifier or an element name, short enough that no single value can fill a screen.
MAX_INVENTORIED_CLAIMED_ROLES
The largest number of xades:ClaimedRole values listed for one signature.
MAX_INVENTORIED_CLAIMED_ROLE_CHARS
The largest number of characters of one claimed role that is echoed.
MAX_INVENTORIED_DIGEST_METHODS
The largest number of distinct digest algorithms listed for one signature.
MAX_INVENTORIED_REFERENCE_URIS
The largest number of ds:Reference URIs listed for one signature.
MAX_INVENTORIED_SIGNATURES
The largest number of ds:Signature elements the inventory describes. Beyond it the inventory is truncated and signature_inventory_truncated is reported; signatures_present still counts every signature.
MAX_INVENTORIED_TIMESTAMPS
The largest number of es:TimeStamp elements the inventory describes.
MAX_INVENTORIED_XADES_PROPERTIES
The largest number of XAdES qualifying-property names listed for one signature.
XADES_NAMESPACES
The XAdES namespaces the signature inventory recognises: 1.1.1, 1.2.2, 1.3.2, and 1.4.1. A qualifying-properties element in any other namespace is not described, because its element names would not mean what they say.
XMLDSIG_NAMESPACE

Functions§

declared_encoding
Read the encoding pseudo-attribute of the XML declaration only.
decode_document_with
Decode one document of dossier, decrypting it when the options allow.
id_map
The XML ID space of a dossier, keyed by ID value.
parse
Parse a bounded e-dossier from memory, accepting the known-compatible namespaces only.
parse_with_options
Parse a bounded e-dossier from memory with an explicit namespace policy.
sanitize_display
Strip the characters a terminal would act on rather than show, and bound the result to limit characters.
sniff
Classify a decoded payload from a bounded prefix of its bytes.