http-msgsign-draft 0.3.0

Add functionality for draft-cavage-http-signatures-12 to http.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::{Display, Formatter};

#[derive(Debug, Eq, PartialEq, Hash)]
pub struct SignBaseComponent {
    pub(crate) id: String,
    pub(crate) value: Option<String>,
}

impl Display for SignBaseComponent {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match &self.value {
            Some(val) => write!(f, "{}: {}", self.id, val),
            None => write!(f, "{}: ", self.id),
        }
    }
}