use alloc::vec::Vec;
use secrecy::SecretSlice;
use crate::{crypto::Result, jwa};
pub(crate) trait PublicKey: Sized + Clone {
fn new(alg: jwa::EcDSA, x: Vec<u8>, y: Vec<u8>) -> Result<Self>;
fn to_point(&self) -> (Vec<u8>, Vec<u8>);
fn verify(&mut self, msg: &[u8], signature: &[u8]) -> Result<bool>;
}
pub(crate) trait PrivateKey: Sized + Clone {
type Signature: Into<Vec<u8>> + AsRef<[u8]>;
type PublicKey: PublicKey;
fn new(alg: jwa::EcDSA, x: Vec<u8>, y: Vec<u8>, d: SecretSlice<u8>) -> Result<Self>;
fn generate(alg: jwa::EcDSA) -> Result<Self>;
fn private_material(&self) -> SecretSlice<u8>;
fn public_point(&self) -> (Vec<u8>, Vec<u8>);
fn to_public_key(&self) -> Self::PublicKey;
fn sign(&mut self, data: &[u8], deterministic: bool) -> Result<Self::Signature>;
}