pub struct PckCerts { /* private fields */ }
Implementations§
Source§impl PckCerts
impl PckCerts
pub fn new(pck_data: Vec<PckCertBodyItem>, ca_chain: Vec<String>) -> Self
pub fn parse(body: &str, ca_chain: Vec<String>) -> Result<PckCerts, Error>
pub fn filename(qe_id: &[u8]) -> String
pub fn store(&self, output_dir: &str, qe_id: &[u8]) -> Result<String, Error>
pub fn store_if_not_exist( &self, output_dir: &str, qe_id: &[u8], ) -> Result<Option<PathBuf>, Error>
pub fn restore(input_dir: &str, qe_id: &[u8]) -> Result<Self, Error>
pub fn fmspc(&self) -> Result<Fmspc, Error>
pub fn ca_chain(&self) -> &[String]
Sourcepub fn iter(&self) -> impl Iterator<Item = &Vec<u8>>
pub fn iter(&self) -> impl Iterator<Item = &Vec<u8>>
Returns an iterator over the pck certificates (in der format) in this structure. WARNING: Missing, or malformed certificates are hidden from the iterator
Sourcepub fn as_pck_certs(&self) -> Vec<PckCert<Unverified>>
pub fn as_pck_certs(&self) -> Vec<PckCert<Unverified>>
Returns a Vec
of PckCert
in this structure.
WARNING: Missing, or malformed certificates are hidden from the iterator
Sourcepub fn select_pck<V: VerificationType>(
&self,
tcb_info: &TcbData<V>,
cpusvn: &[u8; 16],
pcesvn: u16,
pceid: u16,
) -> Result<PckCert<Unverified>, Error>
pub fn select_pck<V: VerificationType>( &self, tcb_info: &TcbData<V>, cpusvn: &[u8; 16], pcesvn: u16, pceid: u16, ) -> Result<PckCert<Unverified>, Error>
Given the cpusvn, pcesvn and qe_id, searches for the best PCK certificate Code re-implements https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/ab8d31d72f842adb4b8a49eb3639f2e9a789d13b/tools/PCKCertSelection/PCKCertSelectionLib/pck_sorter.cpp#L441
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PckCerts
impl<'de> Deserialize<'de> for PckCerts
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<V> TryFrom<Vec<PckCert<V>>> for PckCertswhere
V: VerificationType,
NOTE: This conversion is only correct if all PCK certs in the vec have the
same CA chain.
impl<V> TryFrom<Vec<PckCert<V>>> for PckCertswhere
V: VerificationType,
NOTE: This conversion is only correct if all PCK certs in the vec have the same CA chain.
impl Eq for PckCerts
impl StructuralPartialEq for PckCerts
Auto Trait Implementations§
impl Freeze for PckCerts
impl RefUnwindSafe for PckCerts
impl Send for PckCerts
impl Sync for PckCerts
impl Unpin for PckCerts
impl UnwindSafe for PckCerts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more