mirror of
https://github.com/tlsnotary/tlsn-quote-verification.git
synced 2026-01-07 22:53:51 -05:00
28 lines
779 B
Rust
28 lines
779 B
Rust
use intel_tee_quote_verification_rs::*;
|
|
use std::env;
|
|
use std::time::{SystemTime, UNIX_EPOCH};
|
|
|
|
fn main() {
|
|
let args: Vec<String> = env::args().collect();
|
|
if args.len() != 2 {
|
|
eprintln!("Usage: {} <quote_file>", args[0]);
|
|
std::process::exit(1);
|
|
}
|
|
|
|
let quote_path = &args[1];
|
|
let quote_bytes = std::fs::read(quote_path).expect("Failed to read quote file");
|
|
|
|
// Use current UNIX time
|
|
let current_time = SystemTime::now()
|
|
.duration_since(UNIX_EPOCH)
|
|
.unwrap()
|
|
.as_secs() as i64;
|
|
|
|
let result = tee_verify_quote("e_bytes, None, current_time, None, None);
|
|
|
|
match result {
|
|
Ok(_) => println!("Quote verification succeeded"),
|
|
Err(e) => println!("Quote verification failed: {:?}", e),
|
|
}
|
|
}
|