libkeri/lib.rs
1//! KERI (Key Event Receipt Infrastructure) library implementation in Rust.
2
3// Error handling module
4mod errors;
5
6// Re-export Error type
7pub use crate::errors::Error;
8
9mod cesr;
10mod hio;
11mod keri;
12
13pub use crate::cesr::Matter;
14
15/// Initialize the KERI library
16pub fn init() -> Result<(), Error> {
17 // Initialize sodiumoxide
18 if let Err(_) = sodiumoxide::init() {
19 return Err(Error::CryptographicError(
20 "Failed to initialize sodiumoxide".into(),
21 ));
22 }
23
24 Ok(())
25}
26
27#[cfg(test)]
28mod tests {
29 use super::*;
30
31 #[test]
32 fn test_init() {
33 assert!(init().is_ok());
34 }
35}