Skip to main content

CsvGuest

Struct CsvGuest 

Source
pub struct CsvGuest(/* private fields */);
Expand description

A handle to the CSV guest device.

Implementations§

Source§

impl CsvGuest

Source

pub fn open() -> Result<CsvGuest>

Generate a handle to the CSV guest platform via /dev/csv-guest.

Source

pub fn get_report( &mut self, data: Option<[u8; 64]>, mnonce: Option<[u8; 16]>, ) -> Result<AttestationReportWrapper, Error>

Requests an legacy attestation report (i.e. AttestationReportV1) from the HYGON Secure Processor.

Hygon CSV1,CSV2 only support legacy attestation report. Hygon CSV3 supports legacy attestation report, and supports extended attestation report (i.e. AttestationReportV2) if the firmware has a build version >= 2337.

Source

pub fn get_report_ext( &mut self, data: Option<[u8; 64]>, mnonce: Option<[u8; 16]>, flags: u32, ) -> Result<AttestationReportWrapper, Error>

Requests an extended attestation report (i.e. AttestationReportV2) from the HYGON Secure Processor.

Hygon CSV1,CSV2 only support legacy attestation report. Hygon CSV3 supports legacy attestation report, and supports extended attestation report if the firmware has a build version >= 2337.

If extended attestation report is not supported, then request legacy attestation report.

Source

pub fn req_rtmr_status(&mut self) -> Result<CsvGuestUserRtmrStatus, Error>

Request rtmr_status

Source

pub fn req_rtmr_start( &mut self, version: u16, ) -> Result<CsvGuestUserRtmrStart, Error>

Request rtmr_start

Source

pub fn req_rtmr_read( &mut self, bitmap: u32, ) -> Result<(Box<[u8]>, &mut CsvGuestUserRtmrRead), Error>

Request rtmr_read

Source

pub fn req_rtmr_extend( &mut self, index: u8, data: &[u8], ) -> Result<CsvGuestUserRtmrExtend, Error>

Request rtmr_extend

Source

pub fn check_rtmr_supported(&mut self) -> bool

Query if the rtmr is supported. The rtmr_status request will succeed when rtmr is supported.

Source

pub fn check_attestation_report_v2_supported(&mut self) -> bool

Query if AttestationReportV2 is supported. It’s supported when rtmr is supported.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,