#![forbid(unsafe_code)]
#![allow(missing_docs)] #![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::private_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
use wasm_bindgen::prelude::*;
#[cfg(feature = "verify-composite")]
mod composite;
#[cfg(feature = "verify-composite")]
pub use composite::{CompositeSignature, CompositeVerificationResult};
#[cfg(feature = "verify-transparency")]
mod transparency;
#[cfg(feature = "verify-transparency")]
pub use transparency::{
InclusionProof, MerkleTree, compute_artifact_hash, compute_leaf_hash, tree_head_from_json,
verify_inclusion_with_head,
};
#[cfg(feature = "verify-attributes")]
mod attributes;
#[cfg(feature = "verify-attributes")]
pub use attributes::Predicate;
#[cfg(feature = "verify-signatif")]
pub mod signatif;
#[cfg(feature = "verify-pki")]
mod pki;
#[cfg(feature = "verify-pki")]
pub use pki::{Certificate, SignedData};
#[cfg(feature = "sign")]
mod signer;
#[cfg(feature = "sign")]
pub use signer::{Cmp20Signer, Gg18Signer};
#[wasm_bindgen]
pub fn version() -> String {
env!("CARGO_PKG_VERSION").to_string()
}
#[wasm_bindgen]
pub fn core_version() -> String {
"0.2.0".to_string()
}
#[cfg(feature = "verify-pki")]
#[wasm_bindgen]
pub fn canonicalize_xml(xml: &str) -> Result<String, JsValue> {
confium_pki::xmldsig::canonicalize(xml).map_err(|e| JsValue::from_str(&e.to_string()))
}
#[cfg(feature = "verify-pki")]
#[wasm_bindgen]
pub fn canonicalize_exclusive_xml(xml: &str) -> Result<String, JsValue> {
confium_pki::xmldsig::canonicalize_exclusive(xml).map_err(|e| JsValue::from_str(&e.to_string()))
}