#[cfg(feature = "qssh")]
pub mod qssh;
pub mod traits {
use async_trait::async_trait;
use serde::{Serialize, Deserialize};
#[async_trait]
pub trait TransportIntegration: Send + Sync {
async fn send_data(&self, data: &[u8]) -> Result<(), Box<dyn std::error::Error>>;
async fn recv_data(&self) -> Result<Vec<u8>, Box<dyn std::error::Error>>;
fn is_connected(&self) -> bool;
}
#[async_trait]
pub trait SessionIntegration: Send + Sync {
async fn store_session(&self, id: &[u8], data: &[u8]) -> Result<(), Box<dyn std::error::Error>>;
async fn get_session(&self, id: &[u8]) -> Result<Option<Vec<u8>>, Box<dyn std::error::Error>>;
async fn remove_session(&self, id: &[u8]) -> Result<bool, Box<dyn std::error::Error>>;
}
pub trait KeyIntegration: Send + Sync {
fn derive_keys(&self, master_secret: &[u8]) -> Result<SessionKeys, Box<dyn std::error::Error>>;
fn export_keying_material(&self, label: &str, length: usize) -> Result<Vec<u8>, Box<dyn std::error::Error>>;
}
#[derive(Debug, Clone)]
pub struct SessionKeys {
pub client_write_key: Vec<u8>,
pub server_write_key: Vec<u8>,
pub client_write_iv: Vec<u8>,
pub server_write_iv: Vec<u8>,
}
}