use crate::{
collection::ArrayVectorU8,
x509::{CvCertificate, CvTrustAnchor, MAX_INTERMEDIATES},
};
#[derive(Debug)]
pub struct VerifiedPath<'any, 'bytes> {
end_entity: &'any CvCertificate<'any, 'bytes, true>,
intermediates: ArrayVectorU8<&'any CvCertificate<'any, 'bytes, false>, MAX_INTERMEDIATES>,
trust_anchor: &'any CvTrustAnchor<'any, 'bytes>,
}
impl<'any, 'bytes> VerifiedPath<'any, 'bytes> {
pub(crate) fn new(
end_entity: &'any CvCertificate<'any, 'bytes, true>,
intermediates: ArrayVectorU8<&'any CvCertificate<'any, 'bytes, false>, MAX_INTERMEDIATES>,
trust_anchor: &'any CvTrustAnchor<'any, 'bytes>,
) -> Self {
Self { end_entity, intermediates, trust_anchor }
}
pub fn end_entity(&self) -> &'any CvCertificate<'any, 'bytes, true> {
self.end_entity
}
pub fn intermediates(&self) -> &[&'any CvCertificate<'any, 'bytes, false>] {
&self.intermediates
}
pub(crate) fn intermediates_mut(
&mut self,
) -> &mut ArrayVectorU8<&'any CvCertificate<'any, 'bytes, false>, MAX_INTERMEDIATES> {
&mut self.intermediates
}
pub fn trust_anchor(&self) -> &'any CvTrustAnchor<'any, 'bytes> {
self.trust_anchor
}
pub(crate) fn trust_anchor_mut(&mut self) -> &mut &'any CvTrustAnchor<'any, 'bytes> {
&mut self.trust_anchor
}
}