mod decode;
mod decrypt;
mod error;
mod inventory;
mod model;
mod parse;
mod scan;
mod sniff;
mod xml;
pub use decode::{DecodeOutcome, DecodedDocument, UnsupportedReason, decode_document_with};
pub use decrypt::{DecryptOptions, RecipientKey};
pub use error::{Error, ErrorCode};
pub use model::{
Document, Dossier, Limits, MAX_INVENTORIED_DIGEST_METHODS, MAX_INVENTORIED_REFERENCE_URIS,
MAX_INVENTORIED_SIGNATURES, MAX_INVENTORIED_TIMESTAMPS, MAX_INVENTORIED_XADES_PROPERTIES,
MimeType, ParseOptions, SignatureEvidence, SignaturePlacement, SignatureSummary,
StructuralWarning, StructuralWarningCode, TimestampPlacement, TimestampSummary,
};
pub use sniff::{DetectedType, sniff};
pub use xml::{XmlSource, id_map};
pub use roxmltree;
pub const ESZIGNO_NAMESPACE: &str = "https://www.microsec.hu/ds/e-szigno30#";
pub const XMLDSIG_NAMESPACE: &str = "http://www.w3.org/2000/09/xmldsig#";
pub const XADES_NAMESPACES: &[&str] = &[
"http://uri.etsi.org/01903/v1.1.1#",
"http://uri.etsi.org/01903/v1.2.2#",
"http://uri.etsi.org/01903/v1.3.2#",
"http://uri.etsi.org/01903/v1.4.1#",
];
pub const KNOWN_COMPATIBLE_NAMESPACES: &[&str] = &[
ESZIGNO_NAMESPACE,
"http://www.e-cegjegyzek.hu/2007/e-cegeljaras#",
"http://www.e-cegjegyzek.hu/2009/e-cegeljaras#",
"http://www.e-cegjegyzek.hu/2012/e-cegeljaras#",
"http://www.e-cegjegyzek.hu/2014/e-cegeljaras#",
];
pub fn parse(bytes: &[u8], limits: &Limits) -> Result<Dossier, Error> {
parse_with_options(bytes, &ParseOptions::with_limits(limits.clone()))
}
pub fn parse_with_options(bytes: &[u8], options: &ParseOptions) -> Result<Dossier, Error> {
parse::parse(bytes, options)
}