mod decrypt;
mod encrypt;
mod pair;
mod secret;
mod sign;
mod user;
mod verify;
pub use decrypt::*;
pub use encrypt::*;
pub use pair::*;
pub use secret::*;
pub use sign::*;
pub use user::*;
pub use verify::*;
#[derive(Clone, Debug)]
pub struct KeyPair {
pub pub_key: String,
pub priv_key: String,
pub epub_key: Option<String>,
pub epriv_key: Option<String>,
}
pub async fn pair() -> Result<KeyPair, SeaError> {
pair::generate_pair().await
}
pub struct UserAuth {
pub pair: KeyPair,
pub alias: Option<String>,
}
#[derive(Debug, thiserror::Error)]
pub enum SeaError {
#[error("Crypto error: {0}")]
Crypto(String),
#[error("Invalid key format")]
InvalidKey,
#[error("Signature verification failed")]
VerificationFailed,
#[error("Encryption error: {0}")]
Encryption(String),
#[error("Decryption error: {0}")]
Decryption(String),
}