Crates.io | solana_switchboard_attestation_program_sdk |
lib.rs | solana_switchboard_attestation_program_sdk |
version | 0.1.3 |
source | src |
created_at | 2023-04-13 10:54:29.119755 |
updated_at | 2023-04-13 11:16:46.188605 |
description | A Rust library to interact with Switchboard V3 attestations. |
homepage | https://docs.switchboard.xyz |
repository | https://github.com/switchboard-xyz |
max_upload_size | |
id | 838160 |
size | 6,046 |
This is the solana program module to be used along with the Switchboard Attestation Client
Use this module to verify attestions match a certain enclave measurement and the associated signer.
let sgx_quote_account_info = <QUOTE_ACCOUNT_INFO>;
let quote_key = sgx_quote_account_info.key;
let mr_enclave = "IN0WD0ApAbKcAFBHK6xYS5QyToq7oJdnIVRJyq6brdM=";
let quote_data = sgx_quote_account_info.try_borrow_data().unwrap();
// TODO: check discriminator
let quote = bytemuck::from_bytes::<QuoteAccountData>(&data[8..]);
quote.check_measurement(mr_enclave.into(), quote_key, Clock::get())?;
msg!("Attestation for key {:?} verified.")
msg!("Key is bound to {}, sgx_quote_account_info.key, mr_enclave);