pub struct Verified {
pub id: String,
pub cert: Certificate,
pub expires_at: DateTime<Utc>,
}Expand description
A certificate whose signature verified against a trusted key.
Fields§
§id: Stringsha256:<hex> of the signed certificate’s JCS bytes.
cert: Certificate§expires_at: DateTime<Utc>Implementations§
Source§impl Verified
impl Verified
Sourcepub fn threshold_for(&self, segment: Option<&str>) -> f64
pub fn threshold_for(&self, segment: Option<&str>) -> f64
The threshold for a case in segment: a certified segment’s own, else the top-level one.
pub fn is_expired(&self, now: DateTime<Utc>) -> bool
Sourcepub fn confidence_bins(&self) -> Option<&[f64]>
pub fn confidence_bins(&self) -> Option<&[f64]>
The bin edges of a v1.2 certificate’s confidence histograms; None before v1.2.
Sourcepub fn histogram_for(&self, segment: Option<&str>) -> Option<&Histogram>
pub fn histogram_for(&self, segment: Option<&str>) -> Option<&Histogram>
The stored confidence histogram of the cases decided by the same threshold as a case in
segment: a certified segment’s own, else the top level’s. None before v1.2, or when the
issuer withheld it.
Sourcepub fn probabilities(&self, scores: &[f64]) -> Option<Vec<f64>>
pub fn probabilities(&self, scores: &[f64]) -> Option<Vec<f64>>
The probabilities the certificate’s calibration map gives a case’s raw scores, one per
option (spec v1.2 §1, probabilities). None when the map’s kind is not one this crate
applies (MAP_KINDS), its params do not fit that kind, or scores does not have one score
per option, or the map is dr in a certificate before v1.2, which did not define it. A
consumer refuses a certificate whose map it does not apply (spec v1.2 §4).
Sourcepub fn confidence(&self, scores: &[f64]) -> Option<f64>
pub fn confidence(&self, scores: &[f64]) -> Option<f64>
A case’s confidence: the largest of its Verified::probabilities. A case is answered when
this is at least Verified::threshold_for its segment (and the rule does not abstain on it).
Sourcepub fn temperature(&self) -> Option<f64>
pub fn temperature(&self) -> Option<f64>
The temperature of a kind: temperature calibration map; None for other kinds.