1#![forbid(unsafe_code)]
11#![allow(missing_docs)] #![allow(rustdoc::broken_intra_doc_links)]
13#![allow(rustdoc::bare_urls)]
14#![allow(rustdoc::redundant_explicit_links)]
15#![allow(rustdoc::private_intra_doc_links)]
16#![allow(rustdoc::invalid_html_tags)]
17
18use wasm_bindgen::prelude::*;
19
20#[cfg(feature = "verify-composite")]
21mod composite;
22
23#[cfg(feature = "verify-composite")]
24pub use composite::{CompositeSignature, CompositeVerificationResult};
25
26#[cfg(feature = "verify-transparency")]
27mod transparency;
28
29#[cfg(feature = "verify-transparency")]
30pub use transparency::{
31 InclusionProof, MerkleTree, compute_artifact_hash, compute_leaf_hash, tree_head_from_json,
32 verify_inclusion_with_head,
33};
34
35#[cfg(feature = "verify-attributes")]
36mod attributes;
37
38#[cfg(feature = "verify-attributes")]
39pub use attributes::Predicate;
40
41#[cfg(feature = "verify-signatif")]
42pub mod signatif;
43
44#[cfg(feature = "verify-pki")]
45mod pki;
46
47#[cfg(feature = "verify-pki")]
48pub use pki::{Certificate, SignedData};
49
50#[cfg(feature = "sign")]
51mod signer;
52
53#[cfg(feature = "sign")]
54pub use signer::{Cmp20Signer, Gg18Signer};
55
56#[wasm_bindgen]
58pub fn version() -> String {
59 env!("CARGO_PKG_VERSION").to_string()
60}
61
62#[wasm_bindgen]
64pub fn core_version() -> String {
65 "0.2.0".to_string()
66}
67
68#[cfg(feature = "verify-pki")]
70#[wasm_bindgen]
71pub fn canonicalize_xml(xml: &str) -> Result<String, JsValue> {
72 confium_pki::xmldsig::canonicalize(xml).map_err(|e| JsValue::from_str(&e.to_string()))
73}
74
75#[cfg(feature = "verify-pki")]
77#[wasm_bindgen]
78pub fn canonicalize_exclusive_xml(xml: &str) -> Result<String, JsValue> {
79 confium_pki::xmldsig::canonicalize_exclusive(xml).map_err(|e| JsValue::from_str(&e.to_string()))
80}