use crate::Error;
use crate::algorithm::Algorithm;
use crate::signer::Signer;
#[derive(Debug, Default)]
pub struct SigstoreSigner;
impl SigstoreSigner {
#[must_use]
pub fn new() -> Self {
Self
}
}
impl Signer for SigstoreSigner {
fn algorithm(&self) -> Algorithm {
Algorithm::P256
}
fn keyid(&self) -> Result<String, Error> {
Err(Error::SigstoreNotImplemented)
}
fn sign(&mut self, _pae: &[u8]) -> Result<Vec<u8>, Error> {
Err(Error::SigstoreNotImplemented)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn both_methods_return_not_implemented() {
let mut s = SigstoreSigner::new();
assert!(matches!(s.keyid(), Err(Error::SigstoreNotImplemented)));
assert!(matches!(s.sign(b"pae"), Err(Error::SigstoreNotImplemented)));
}
}