-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the ability to perform local validation of proof and signature with plexi. You can run the following example ``` \# Set auditor validation key PLEXI_VERIFYING_KEY="$(curl -sS https://plexi.key-transparency.cloudflare.com/info | jq -r '.keys[0].public_key')" \# Download an akd proof curl -sS https://d1tfr3x7n136ak.cloudfront.net/458298/5f02bf9c5526151669914c4b80a300870e583b6b32e2c537ee4fa4f589fe889d/3ae9497069cc722dc9e00f8251da87071646a57dae2fc7882f1d8214961d80bd > /tmp/proof \# Retrieve epoch, and pass it to the local audit alongside the proof curl -sS https://plexi.key-transparency.cloudflare.com/namespaces/whatsapp.key-transparency.v1/audits/458298 | cargo run -- local-audit --proof-path /tmp/proof --long ``` To do before merge * Add test with real data, possibly the above example. I need to find the right too in Rust to do this * Consider overloading `plexi audit` instead. If an input is present on stdin, or an input path is provided, it's local validation. This might be too complex * Consider printing the previous epoch infered from the provided consistency proof Closes #12
- Loading branch information
Showing
5 changed files
with
208 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::io::Write as _; | ||
|
||
use log::log_enabled; | ||
use tokio::{ | ||
task::JoinHandle, | ||
time::{interval, Duration}, | ||
}; | ||
|
||
pub fn print_dots() -> JoinHandle<()> { | ||
async fn print_dots_routine() { | ||
let mut interval = interval(Duration::from_secs(1)); | ||
loop { | ||
interval.tick().await; | ||
if log_enabled!(log::Level::Error) { | ||
eprint!("."); | ||
} | ||
std::io::stderr().flush().unwrap(); | ||
} | ||
} | ||
|
||
tokio::spawn(print_dots_routine()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters