[−][src]Struct rust_sgx_util::IasHandle
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]
api_key: &str,
verify_url: Option<&str>,
sigrl_url: Option<&str>
) -> Result<Self>
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:
- IAS verification - dev/attestation/v3/report
- IAS SigRL - dev/attestation/v3/sigrl
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]
&self,
quote: &Quote,
nonce: Option<&Nonce>,
report_path: Option<&Path>,
sig_path: Option<&Path>,
cert_path: Option<&Path>,
advisory_path: Option<&Path>
) -> Result<()>
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("e, None, None, None, None, None); assert!(res.is_err());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for IasHandle
impl !Send for IasHandle
impl !Sync for IasHandle
impl Unpin for IasHandle
impl UnwindSafe for IasHandle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,