[][src]Struct rust_sgx_util::Quote

pub struct Quote(_);

A thin wrapper around vector of bytes. Represents quote obtained from the challenged enclave.

Accessing the underlying bytes buffer

Quote implements Deref<Target=[u8]>, therefore dereferencing it will yield its inner buffer of bytes.

Serializing/deserializing

With with_serde feature enabled, Quote can be serialized and deserialized as base64 String.

Methods

impl Quote[src]

pub fn report_data(&self) -> Result<&[u8]>[src]

Returns report_data bytes embedded within this Quote.

The size of the returned slice is 64 bytes.

Errors

This function will fail with Error::QuoteTooShort if Quote is shorter than 432 bytes. Note that this is only a quick check that we can extract the region in Quote's buffer where we expect the report_data to lie in. We don't do any validations on the Quote in this method.

Examples

let quote = Quote::from(&[0u8; 438][..]);
assert_eq!(quote.report_data().unwrap().len(), 64);

let quote = Quote::from(&[0u8; 10][..]);
assert!(quote.report_data().is_err());

Trait Implementations

impl Clone for Quote[src]

impl Debug for Quote[src]

impl Deref for Quote[src]

type Target = [u8]

The resulting type after dereferencing.

impl<'_> From<&'_ [u8]> for Quote[src]

impl From<Vec<u8>> for Quote[src]

Auto Trait Implementations

impl RefUnwindSafe for Quote

impl Send for Quote

impl Sync for Quote

impl Unpin for Quote

impl UnwindSafe for Quote

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.