use pki_types::CertificateDer;
use crate::sign;
pub(super) struct ActiveCertifiedKey<'a> {
key: &'a sign::CertifiedKey,
ocsp: Option<&'a [u8]>,
}
impl<'a> ActiveCertifiedKey<'a> {
pub(super) fn from_certified_key(key: &sign::CertifiedKey) -> ActiveCertifiedKey<'_> {
ActiveCertifiedKey {
key,
ocsp: key.ocsp.as_deref(),
}
}
#[inline]
pub(super) fn get_cert(&self) -> &[CertificateDer<'static>] {
&self.key.cert
}
#[inline]
pub(super) fn get_key(&self) -> &dyn sign::SigningKey {
&*self.key.key
}
#[inline]
pub(super) fn get_ocsp(&self) -> Option<&[u8]> {
self.ocsp
}
}