use super::error::Result;
use super::types::Platform;
pub trait Signer: Send + Sync {
fn sign(&self, platform: &Platform, data: &[u8]) -> Result<Vec<u8>>;
fn public_key(&self, platform: &Platform) -> Result<Vec<u8>>;
fn verify(&self, platform: &Platform, data: &[u8], signature: &[u8]) -> Result<()>;
}
#[async_trait::async_trait]
pub trait AsyncSigner: Send + Sync {
async fn sign(&self, platform: &Platform, data: &[u8]) -> Result<Vec<u8>>;
async fn public_key(&self, platform: &Platform) -> Result<Vec<u8>>;
async fn verify(&self, platform: &Platform, data: &[u8], signature: &[u8]) -> Result<()>;
}