pub use x509_cert as x509;
use core::cmp::Ordering;
use der::{asn1::ObjectIdentifier, Any, Choice, Sequence, ValueOrd};
use x509_cert::name::Name;
use x509_cert::serial_number::SerialNumber;
use x509_cert::Certificate;
#[derive(Clone, Debug, Eq, PartialEq, Choice)]
#[allow(missing_docs)]
#[allow(clippy::large_enum_variant)]
pub enum CertificateChoices {
Certificate(Certificate),
#[asn1(context_specific = "3", tag_mode = "EXPLICIT", constructed = "true")]
Other(OtherCertificateFormat),
}
impl ValueOrd for CertificateChoices {
fn value_cmp(&self, other: &Self) -> der::Result<Ordering> {
use der::DerOrd;
use der::Encode;
self.to_der()?.der_cmp(&other.to_der()?)
}
}
#[derive(Clone, Debug, Eq, PartialEq, Sequence)]
#[allow(missing_docs)]
pub struct OtherCertificateFormat {
pub other_cert_format: ObjectIdentifier,
pub other_cert: Any,
}
#[derive(Clone, Debug, Eq, PartialEq, Sequence)]
#[allow(missing_docs)]
pub struct IssuerAndSerialNumber {
pub issuer: Name,
pub serial_number: SerialNumber,
}