use crate::courierust_tls::RootStore;
#[derive(Clone)]
pub struct ClientAuth {
roots: RootStore,
required: bool,
}
impl ClientAuth {
pub fn required(roots: RootStore) -> Self {
Self {
roots,
required: true,
}
}
pub fn optional(roots: RootStore) -> Self {
Self {
roots,
required: false,
}
}
pub fn roots(&self) -> &RootStore {
&self.roots
}
pub fn is_required(&self) -> bool {
self.required
}
}
impl core::fmt::Debug for ClientAuth {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("ClientAuth")
.field("roots", &self.roots.len())
.field("required", &self.required)
.finish()
}
}