use crate::domain::entities::*; use crate::domain::error::DomainError; pub trait MnemonicGenerator { type Error: Into; fn generate(&self) -> Result; fn validate(&self, words: &[String]) -> Result<(), Self::Error>; } pub trait KeyDeriver { type Error: Into; fn derive_from_seed(&self, seed: &Seed) -> Result<(PublicKey, PrivateKey), Self::Error>; fn derive_from_mnemonic(&self, mnemonic: &RecoveryPhrase) -> Result; } pub trait FileEncryptor { type Error: Into; fn encrypt( &self, seed: &Seed, password: &str, public_key: &PublicKey, did: &Did, ) -> Result; fn decrypt( &self, file: &PassportFile, password: &str, ) -> Result<(Seed, PublicKey, PrivateKey), Self::Error>; } pub trait FileStorage { type Error: Into; fn save(&self, file: &PassportFile, path: &str) -> Result<(), Self::Error>; fn load(&self, path: &str) -> Result; }