Trait sequoia_wot::store::Store
source · pub trait Store {
fn reference_time(&self) -> SystemTime;
fn list<'a>(&'a self) -> Box<dyn Iterator<Item = Fingerprint> + 'a>;
fn cert(&self, kh: &KeyHandle) -> Result<Vec<CertSynopsis>>;
fn certifications_of(
&self,
target: &Fingerprint,
min_depth: Depth
) -> Result<Vec<CertificationSet>>;
fn certs<'a>(&'a self) -> Box<dyn Iterator<Item = CertSynopsis> + 'a> { ... }
fn cert_by_fpr(&self, fingerprint: &Fingerprint) -> Result<CertSynopsis> { ... }
fn third_party_certifications_of(
&self,
fpr: &Fingerprint
) -> Vec<Certification> ⓘ { ... }
fn certified_userids_of(&self, fpr: &Fingerprint) -> Vec<UserID> ⓘ { ... }
fn certified_userids(&self) -> Vec<(Fingerprint, UserID)> ⓘ { ... }
fn with_userid(&self, userid: UserID) -> Vec<Fingerprint> ⓘ { ... }
fn with_email(&self, email: &str) -> Vec<(Fingerprint, UserID)> ⓘ { ... }
}
Required Methods§
sourcefn reference_time(&self) -> SystemTime
fn reference_time(&self) -> SystemTime
Returns the reference time.
sourcefn list<'a>(&'a self) -> Box<dyn Iterator<Item = Fingerprint> + 'a>
fn list<'a>(&'a self) -> Box<dyn Iterator<Item = Fingerprint> + 'a>
Lists all of the certificates.
sourcefn cert(&self, kh: &KeyHandle) -> Result<Vec<CertSynopsis>>
fn cert(&self, kh: &KeyHandle) -> Result<Vec<CertSynopsis>>
Returns the certificates matching the handle.
Returns StoreError::NotFound
if the certificate is not
found. This function SHOULD NOT return an empty vector if the
certificate is not found.
The caller may assume that looking up a fingerprint returns at most one certificate.
sourcefn certifications_of(
&self,
target: &Fingerprint,
min_depth: Depth
) -> Result<Vec<CertificationSet>>
fn certifications_of(
&self,
target: &Fingerprint,
min_depth: Depth
) -> Result<Vec<CertificationSet>>
Returns a certification set for the specified certificate.
A CertificateSet
is returned for the certificate itself as
well as for each User ID (self signed or not) that has a
cryptographically valid certification.
Returns StoreError::NotFound
if the certificate is not
found. This function SHOULD NOT return an empty vector if the
certificate is not found.
An implementation may (but need not) use the min_depth
parameter to filter the the certifications it returns. The
min_depth
parameter says that the caller is only interested
in certifications for which the trust depth is at least
min_depth
. If an implementation returns certifications
whose trust depth is less than min_depth
the caller must
ignore them.
Provided Methods§
sourcefn certs<'a>(&'a self) -> Box<dyn Iterator<Item = CertSynopsis> + 'a>
fn certs<'a>(&'a self) -> Box<dyn Iterator<Item = CertSynopsis> + 'a>
Returns all of the certificates.
sourcefn cert_by_fpr(&self, fingerprint: &Fingerprint) -> Result<CertSynopsis>
fn cert_by_fpr(&self, fingerprint: &Fingerprint) -> Result<CertSynopsis>
Returns the corresponding certificate, if any.
Returns StoreError::NotFound
if the certificate is not
found. This function SHOULD NOT return an empty vector if the
certificate is not found.
sourcefn third_party_certifications_of(&self, fpr: &Fingerprint) -> Vec<Certification> ⓘ
fn third_party_certifications_of(&self, fpr: &Fingerprint) -> Vec<Certification> ⓘ
Returns all third-party certifications of the specified certificate.
Returns StoreError::NotFound
if the certificate is not
found. This function SHOULD NOT return an empty vector if the
certificate is not found.
sourcefn certified_userids_of(&self, fpr: &Fingerprint) -> Vec<UserID> ⓘ
fn certified_userids_of(&self, fpr: &Fingerprint) -> Vec<UserID> ⓘ
Returns all User IDs that were certified for the specified certificate.
This returns both self-signed User IDs, and User IDs certified by third-parties for the specified certificate. The result is deduped.
Returns StoreError::NotFound
if the certificate is not
found. This function SHOULD NOT return an empty vector if the
certificate is not found.
sourcefn certified_userids(&self) -> Vec<(Fingerprint, UserID)> ⓘ
fn certified_userids(&self) -> Vec<(Fingerprint, UserID)> ⓘ
Returns all User IDs that were certified.
This returns both self-signed User IDs, and User IDs certified by third-parties. The result is deduped.
sourcefn with_userid(&self, userid: UserID) -> Vec<Fingerprint> ⓘ
fn with_userid(&self, userid: UserID) -> Vec<Fingerprint> ⓘ
Returns all certificates that may have the specified User ID.
This returns both self-signed User IDs, and User IDs certified by third-parties. It is okay for this function to return false positives, i.e., certificates that on closer inspection shouldn’t be associated with that User ID.
sourcefn with_email(&self, email: &str) -> Vec<(Fingerprint, UserID)> ⓘ
fn with_email(&self, email: &str) -> Vec<(Fingerprint, UserID)> ⓘ
Returns all certificates that may have a User ID with the specified email address.
This returns both self-signed User IDs, and User IDs certified by third-parties. It is okay for this function to return false positives, i.e., certificates that on closer inspection shouldn’t be associated with that User ID.
Implementations on Foreign Types§
source§impl<T> Store for Box<T>where
T: Store + ?Sized,
impl<T> Store for Box<T>where
T: Store + ?Sized,
source§fn reference_time(&self) -> SystemTime
fn reference_time(&self) -> SystemTime
Returns the reference time.
source§fn list<'a>(&'a self) -> Box<dyn Iterator<Item = Fingerprint> + 'a>
fn list<'a>(&'a self) -> Box<dyn Iterator<Item = Fingerprint> + 'a>
Lists all of the certificates.
source§fn certs<'a>(&'a self) -> Box<dyn Iterator<Item = CertSynopsis> + 'a>
fn certs<'a>(&'a self) -> Box<dyn Iterator<Item = CertSynopsis> + 'a>
Returns all of the certificates.