[][src]Struct rust_sgx_util::IasHandle

pub struct IasHandle { /* fields omitted */ }

Represents a handle to Intel's Attestation Service. It allows the user to perform operations such as getting a SigRL for a specified GroupId, or verifying a specified quote with the IAS.

Methods

impl IasHandle[src]

pub fn new(
    api_key: &str,
    verify_url: Option<&str>,
    sigrl_url: Option<&str>
) -> Result<Self>
[src]

Create new instance with the specified api_key API key, IAS verification URL verify_url, and IAS SigRL URL sigrl_url.

By default, the following URLs are used:

Errors

This function will fail with Error::IasInitNullPtr if initialisation of the handle is unsuccessful, or if converting input arguments to CString fails.

Examples

let _handle = IasHandle::new("012345abcdef", None, None)?;

pub fn get_sigrl(&self, group_id: &GroupId) -> Result<Option<Sigrl>>[src]

Obtain SigRL for the given group_id.

Errors

This function will fail with Error::IasGetSigrlNonZero(_) if the group_id is invalid, or the IasHandle was created with an invalid IAS verification URL.

Examples

use std::str::FromStr;
let handle = IasHandle::new("012345abcdef", None, None)?;
let group_id = GroupId::from_str("01234567")?;
let res = handle.get_sigrl(&group_id);
assert!(res.is_err());

pub fn verify_quote(
    &self,
    quote: &Quote,
    nonce: Option<&Nonce>,
    report_path: Option<&Path>,
    sig_path: Option<&Path>,
    cert_path: Option<&Path>,
    advisory_path: Option<&Path>
) -> Result<()>
[src]

Verify provided quote.

Errors

This function will fail with Error::IasVerifyQuoteNonZero(_) if the provided quote is invalid, or the nonce, or if the IAS server returns a non 200 status code.

Examples

let handle = IasHandle::new("012345abcdef", None, None)?;
let quote = Quote::from(vec![0u8; 100]);
let res = handle.verify_quote(&quote, None, None, None, None, None);
assert!(res.is_err());

Trait Implementations

impl Drop for IasHandle[src]

Auto Trait Implementations

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, 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.