diff --git a/libs/tls/src/lib.rs b/libs/tls/src/lib.rs index 58bf90b66..fdbc45197 100644 --- a/libs/tls/src/lib.rs +++ b/libs/tls/src/lib.rs @@ -21,13 +21,24 @@ const CURRENT_VERSION_KEY: &str = "__version"; #[derive(Archive, Serialize, Deserialize, Debug)] pub struct RustlsOwnedTrustAnchor { - subject: Vec, - spki: Vec, - name_constraints: Option>, + pub subject: Vec, + pub spki: Vec, + pub name_constraints: Option>, } impl RustlsOwnedTrustAnchor { +pub fn from_subject_spki_name_constraints( + subject: impl Into>, + spki: impl Into>, + name_constraints: Option>>, +) -> Self { + Self { + subject: subject.into(), + spki: spki.into(), + name_constraints: name_constraints.map(|x| x.into()) + } +}