1mod decode;
7mod decrypt;
8mod error;
9mod inventory;
10mod model;
11mod parse;
12mod scan;
13mod sniff;
14mod text;
15mod xml;
16
17pub use decode::{DecodeOutcome, DecodedDocument, UnsupportedReason, decode_document_with};
18pub use decrypt::{DecryptOptions, RecipientKey};
19pub use error::{Error, ErrorCode};
20pub use model::{
21 Document, Dossier, Limits, MAX_INVENTORIED_CLAIMED_ROLE_CHARS, MAX_INVENTORIED_CLAIMED_ROLES,
22 MAX_INVENTORIED_DIGEST_METHODS, MAX_INVENTORIED_REFERENCE_URIS, MAX_INVENTORIED_SIGNATURES,
23 MAX_INVENTORIED_TIMESTAMPS, MAX_INVENTORIED_XADES_PROPERTIES, MimeType, ParseOptions,
24 SignatureEvidence, SignaturePlacement, SignatureSummary, StructuralWarning,
25 StructuralWarningCode, TimestampPlacement, TimestampSummary,
26};
27pub use sniff::{DetectedType, sniff};
28pub use text::{MAX_DISPLAY_CHARS, sanitize_display};
29pub use xml::{EncodingDeclaration, XmlSource, declared_encoding, id_map};
30
31pub use roxmltree;
34
35pub const ESZIGNO_NAMESPACE: &str = "https://www.microsec.hu/ds/e-szigno30#";
36pub const XMLDSIG_NAMESPACE: &str = "http://www.w3.org/2000/09/xmldsig#";
37
38pub const XADES_NAMESPACES: &[&str] = &[
42 "http://uri.etsi.org/01903/v1.1.1#",
43 "http://uri.etsi.org/01903/v1.2.2#",
44 "http://uri.etsi.org/01903/v1.3.2#",
45 "http://uri.etsi.org/01903/v1.4.1#",
46];
47
48pub const KNOWN_COMPATIBLE_NAMESPACES: &[&str] = &[
56 ESZIGNO_NAMESPACE,
57 "http://www.e-cegjegyzek.hu/2007/e-cegeljaras#",
58 "http://www.e-cegjegyzek.hu/2009/e-cegeljaras#",
59 "http://www.e-cegjegyzek.hu/2012/e-cegeljaras#",
60 "http://www.e-cegjegyzek.hu/2014/e-cegeljaras#",
61];
62
63pub fn parse(bytes: &[u8], limits: &Limits) -> Result<Dossier, Error> {
66 parse_with_options(bytes, &ParseOptions::with_limits(limits.clone()))
67}
68
69pub fn parse_with_options(bytes: &[u8], options: &ParseOptions) -> Result<Dossier, Error> {
71 parse::parse(bytes, options)
72}