proofmode 0.9.0

Capture, share, and preserve verifiable photos and videos
Documentation
use super::error::Result;
use super::types::Platform;

/// Synchronous signer trait for ES256 signing operations.
/// Suitable for local key-based signing where no async I/O is needed.
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 signer trait for remote signing operations (e.g., AWS KMS).
/// proofsign-rust implements this for KmsSigner; proofmode only defines the trait.
#[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<()>;
}