use crate::error::PluginResult;
use crate::options::OptionView;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
pub enum KeyKind {
Secret = 0,
Public = 1,
Both = 2,
}
pub trait KeyfmtPlugin: Sized {
fn parse(
format: &str,
algorithm_hint: Option<&str>,
bytes: &[u8],
opts: Option<OptionView<'_>>,
) -> PluginResult<Self>;
fn serialize(&self, format: &str) -> PluginResult<Vec<u8>>;
fn kind(&self) -> PluginResult<KeyKind>;
fn algorithm(&self) -> PluginResult<String>;
fn public(&self) -> PluginResult<Self>;
}