Crates.io | occlum-sgx |
lib.rs | occlum-sgx |
version | 0.1.13 |
source | src |
created_at | 2023-06-03 05:11:10.150217 |
updated_at | 2023-06-05 14:36:58.472966 |
description | Lib for generate and verify DCAP SGX Report received from Occlum |
homepage | |
repository | https://github.com/aggregion/occlum-sgx |
max_upload_size | |
id | 881349 |
size | 47,158 |
Implementation for generating and verifying SGX DCAP quotes for Occlum
Docs: https://docs.rs/occlum-sgx/
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"
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(())
}