use crate::{Domain, Error, PublicKey, SecretKey, Signature};
#[derive(Clone, Debug)]
pub struct Keys {
pub sk: SecretKey,
pub pk: PublicKey,
}
impl Keys {
pub fn verify_domain(&self, domain: Domain, sig: &Signature, msg: &[u8]) -> Result<(), Error> {
self.pk.verify_domain(domain, sig, msg)
}
pub fn sign_domain(&self, domain: Domain, msg: &[u8]) -> Signature {
self.sk.sign_domain(domain, msg)
}
pub fn sign(&self, msg: &[u8]) -> Signature {
self.sign_domain(Domain::default(), msg)
}
pub fn verify(&self, sig: &Signature, msg: &[u8]) -> Result<(), Error> {
self.pk.verify_domain(Domain::default(), sig, msg)
}
pub fn sign_nonce(&self, domain: Domain, nonce: &[u8; 32], msg: &[u8]) -> Signature {
self.sk.sign_nonce(domain, nonce, msg)
}
}