#occlum #sgx #dcap

bin+lib occlum-sgx

Lib for generate and verify DCAP SGX Report received from Occlum

14 releases

0.1.13 Jun 5, 2023
0.1.12 Jun 5, 2023

#246 in Hardware support

Download history 19/week @ 2023-10-27 5/week @ 2023-11-03 6/week @ 2023-11-10 8/week @ 2023-11-17 19/week @ 2023-11-24 60/week @ 2023-12-01 17/week @ 2023-12-08 18/week @ 2023-12-15 32/week @ 2023-12-22 3/week @ 2023-12-29 18/week @ 2024-01-05 5/week @ 2024-01-12 3/week @ 2024-01-19 18/week @ 2024-01-26 15/week @ 2024-02-02 23/week @ 2024-02-09

59 downloads per month
Used in occlum-ratls

MIT/Apache

27KB
514 lines

Occlum SGX Lib

Implementation for generating and verifying SGX DCAP quotes for Occlum

Docs: https://docs.rs/occlum-sgx/

Install

Run the following Cargo command in your project directory:

cargo add occlum-sgx

Or add the following line to your Cargo.toml:

occlum-sgx = "0.1.11"

Requirements

  • SGX Server
  • PCCS
  • The app should be run as an occlum instance in HW sgx mode
  • Occlum's configuration should contain mount devfs.

Usage

use occlum_sgx::SGXQuote;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Generate SGX Quote from report data
    let quote: SGXQuote = [0u8; 64].try_into()?;
    // Check the quote, it's just for reference
    quote.verify()?;

    let mrenclave = quote.mrenclave();
    let mrsigner = quote.mrsigner();
    let product_id = quote.product_id();
    let version = quote.version();

    println!("MrEnclave:\t{}", mrenclave);
    println!("MrSigner:\t{}", mrsigner);
    println!("ProdID:\t{}", product_id);
    println!("Version:\t{}", version);

    println!("\n{:#?}", quote);

    Ok(())
}

Dependencies

~265–380KB