// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
use core::{
convert::Infallible,
fmt::{self, Debug},
ops::{Deref, DerefMut},
};
use alloc::vec::Vec; use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize};
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] // #[cfg_attr( // all(feature = "ffi", not(test)), // safer_ffi_gen::ffi_type(clone, opaque) // )] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A chain of [`DerCertificate`] that is ordered from leaf to root. /// /// Certificate chains MAY leave out root CA's so long as they are /// provided as input to whatever certificate validator ultimately is /// verifying the chain. pubstruct CertificateChain(Vec<DerCertificate>);
impl Deref for CertificateChain { type Target = Vec<DerCertificate>;
impl CertificateChain { /// Get the leaf certificate, which is the first certificate in the chain. pubfn leaf(&self) -> Option<&DerCertificate> { self.0.first()
}
/// Convert this certificate chain into a [`Credential`] enum. pubfn into_credential(self) -> Credential {
Credential::X509(self)
}
}
impl MlsCredential for CertificateChain { type Error = Infallible;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.