pub struct Verifier { /* private fields */ }Expand description
The canonical Verifier. A thin wrapper around verify_structural
kept as a struct so future Tier 3 work can attach a cached
PublicKeysResponse without changing the public API shape.
§Examples
use h33_substrate_verifier::Verifier;
let verifier = Verifier::new();
// Subsequent calls to verifier.verify(...) use the structural path.Implementations§
Source§impl Verifier
impl Verifier
Sourcepub fn verify(
&self,
body: &[u8],
headers: &Headers<'_>,
) -> Result<VerificationResult, VerifierError>
pub fn verify( &self, body: &[u8], headers: &Headers<'_>, ) -> Result<VerificationResult, VerifierError>
Verify an attested response.
Returns Ok(VerificationResult) with per-check verdicts whenever
the inputs are structurally parseable — even if the verdicts
report failure. Returns Err(VerifierError) only when the inputs
themselves are malformed (bad hex, wrong length, etc.).
§Examples
use h33_substrate_verifier::{Headers, Verifier};
let body = b"{\"ok\":true}";
let headers = Headers::from_strs(
"f3a8b2c1deadbeef...",
"012e891fa4cafebabedeadbeef...",
"ML-DSA-65,FALCON-512,SPHINCS+-SHA2-128f",
1_733_942_731_234,
);
let verifier = Verifier::new();
let result = verifier.verify(body, &headers)?;
if result.is_valid() {
println!("Response was legitimately signed by H33");
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Verifier
impl RefUnwindSafe for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnsafeUnpin for Verifier
impl UnwindSafe for Verifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more