#[non_exhaustive]pub struct VerifyOptions {
pub expected_context: Option<Vec<String>>,
pub allowed_suites: Vec<CryptoSuite>,
pub clock_skew: TimeDelta,
}Expand description
Options for verifying a Data Integrity proof.
Currently carries the document’s externally-supplied @context (for
comparison with the proof’s declared context), an optional allowlist
of acceptable cryptosuites, and the tolerance applied to a future
created timestamp. More fields will be added as the library grows —
#[non_exhaustive] ensures future additions do not break callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.expected_context: Option<Vec<String>>Expected @context of the signed document. When Some, the
verifier enforces that the proof’s @context matches.
allowed_suites: Vec<CryptoSuite>If non-empty, the proof’s cryptosuite must appear in this list.
Use to reject proofs produced by suites your policy does not
accept (e.g. refuse bbs-2023 in a context that requires full
disclosure).
clock_skew: TimeDeltaHow far into the verifier’s future a proof’s created may sit
before it is rejected as non-conformant. Defaults to
DEFAULT_CLOCK_SKEW; set to zero for strict rejection of any
future timestamp. Negative values are treated as zero.
Implementations§
Source§impl VerifyOptions
impl VerifyOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a VerifyOptions with no context or cryptosuite
restrictions and the default clock-skew allowance. Equivalent to
VerifyOptions::default.
Sourcepub fn with_expected_context(self, ctx: Vec<String>) -> Self
pub fn with_expected_context(self, ctx: Vec<String>) -> Self
Sets the expected document @context.
Sourcepub fn with_allowed_suites(self, suites: Vec<CryptoSuite>) -> Self
pub fn with_allowed_suites(self, suites: Vec<CryptoSuite>) -> Self
Restricts the set of cryptosuites the verifier will accept.
Sourcepub fn with_clock_skew(self, skew: TimeDelta) -> Self
pub fn with_clock_skew(self, skew: TimeDelta) -> Self
Overrides the tolerance for a created timestamp in the
verifier’s future. Pass chrono::TimeDelta::zero to reject any
future timestamp outright.
Trait Implementations§
Source§impl Clone for VerifyOptions
impl Clone for VerifyOptions
Source§fn clone(&self) -> VerifyOptions
fn clone(&self) -> VerifyOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerifyOptions
impl Debug for VerifyOptions
Source§impl Default for VerifyOptions
impl Default for VerifyOptions
Source§fn default() -> Self
fn default() -> Self
All checks off except a DEFAULT_CLOCK_SKEW allowance on
created — deliberately not #[derive]d, which would mean zero
tolerance and make verification skew-sensitive by default.