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§
- Decoded
Document - Decrypt
Options - How
decode_document_withmay treat an encrypted document. - Document
- Dossier
- Encoding
Declaration - The
encodingpseudo-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.
- Mime
Type - Parse
Options - How a dossier is parsed: the resource limits and the namespaces whose
Dossierroot element is accepted. - Recipient
Key - The recipient private key
extractdecrypts with, together with the certificate that lets aRecipientInfobe recognised as naming it. - Signature
Evidence - 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.
- Signature
Summary - One
ds:Signature, as the XML claims it. - Structural
Warning - One non-fatal structural finding. The message never contains a title, a path, or payload content.
- Timestamp
Summary - 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§
- Decode
Outcome - Detected
Type - Coarse content category of a decoded payload.
- Error
Code - Stable machine-readable categories returned by the core library.
- Signature
Placement - Where a
ds:Signaturesits in the dossier. - Structural
Warning Code - Stable machine-readable categories of non-fatal structural findings.
- Timestamp
Placement - Where an
es:TimeStampsits in the dossier. - Unsupported
Reason - Why a document that parsed could not be turned back into its source bytes.
Constants§
- ESZIGNO_
NAMESPACE - KNOWN_
COMPATIBLE_ NAMESPACES - Namespaces whose
Dossierroot 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:ClaimedRolevalues 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:ReferenceURIs listed for one signature. - MAX_
INVENTORIED_ SIGNATURES - The largest number of
ds:Signatureelements the inventory describes. Beyond it the inventory is truncated andsignature_inventory_truncatedis reported;signatures_presentstill counts every signature. - MAX_
INVENTORIED_ TIMESTAMPS - The largest number of
es:TimeStampelements 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
encodingpseudo-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
limitcharacters. - sniff
- Classify a decoded payload from a bounded prefix of its bytes.