solana_switchboard_attestation_program_sdk

Crates.iosolana_switchboard_attestation_program_sdk
lib.rssolana_switchboard_attestation_program_sdk
version0.1.3
sourcesrc
created_at2023-04-13 10:54:29.119755
updated_at2023-04-13 11:16:46.188605
descriptionA Rust library to interact with Switchboard V3 attestations.
homepagehttps://docs.switchboard.xyz
repositoryhttps://github.com/switchboard-xyz
max_upload_size
id838160
size6,046
(mgild)

documentation

README

solana_switchboard_attestation_program_sdk

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);
Commit count: 0

cargo fmt