use crate::CurveType;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SignatureSuite {
P256,
Ed25519,
}
impl SignatureSuite {
pub fn as_str(&self) -> &'static str {
match self {
SignatureSuite::P256 => "json-canon/p256",
SignatureSuite::Ed25519 => "json-canon/ed25519",
}
}
pub fn parse(raw: &str) -> Option<Self> {
match raw {
"json-canon/p256" => Some(SignatureSuite::P256),
"json-canon/ed25519" => Some(SignatureSuite::Ed25519),
_ => None,
}
}
pub fn curve(&self) -> CurveType {
match self {
SignatureSuite::P256 => CurveType::P256,
SignatureSuite::Ed25519 => CurveType::Ed25519,
}
}
}