pub struct ProvenanceManager { /* private fields */ }Implementations§
Source§impl ProvenanceManager
impl ProvenanceManager
pub fn new(key_path: &Path, storage_path: Option<&Path>) -> Result<Self>
pub fn from_signing_key(signing_key: SigningKey) -> Self
pub fn issuer_did(&self) -> &str
pub fn store_record(&self, fact_id: &str, record: ProvenanceRecord)
pub fn get_record(&self, fact_id: &str) -> Option<ProvenanceRecord>
pub fn record_count(&self) -> usize
pub fn record_deletion( &self, fact_id: &str, reason: Option<&str>, ) -> Result<DeletionRecord>
pub fn rotate_key(&mut self, new_key_path: &Path) -> Result<String>
pub fn verify_log_integrity(&self) -> Result<bool>
pub fn revoke_credential(&self, status_index: u64) -> Result<()>
pub fn is_revoked(&self, status_index: u64) -> bool
Sourcepub fn create_fact_provenance(
&self,
fact_id: &str,
content: &[u8],
source_uri: Option<&str>,
) -> Result<ProvenanceRecord>
pub fn create_fact_provenance( &self, fact_id: &str, content: &[u8], source_uri: Option<&str>, ) -> Result<ProvenanceRecord>
Create a full provenance record for a stored fact.
Sourcepub fn create_triple_provenance(
&self,
params: &TripleProvenanceParams<'_>,
) -> Result<ProvenanceRecord>
pub fn create_triple_provenance( &self, params: &TripleProvenanceParams<'_>, ) -> Result<ProvenanceRecord>
Create a full provenance record for a stored triple.
pub fn create_batch_provenance( &self, items: &[(&str, &[u8], Option<&str>)], ) -> Result<Vec<ProvenanceRecord>>
Sourcepub fn create_store_manifest(
&self,
store_id: &str,
store_data: &[u8],
fact_count: usize,
dimensions: u32,
title: Option<&str>,
) -> Result<StoreManifest>
pub fn create_store_manifest( &self, store_id: &str, store_data: &[u8], fact_count: usize, dimensions: u32, title: Option<&str>, ) -> Result<StoreManifest>
Create a signed manifest for the entire store.
Sourcepub fn verify_fact_provenance(
&self,
record: &ProvenanceRecord,
trust: &TrustStore,
) -> Result<VerificationResult>
pub fn verify_fact_provenance( &self, record: &ProvenanceRecord, trust: &TrustStore, ) -> Result<VerificationResult>
Authenticity check: verifies the record’s signatures and requires the
key that produced them to be present in trust. A record whose embedded
key is not trusted verifies as valid == false even if its signature is
internally consistent. Use ProvenanceManager::self_trust to trust
only this manager’s own key.
Sourcepub fn verify_fact_provenance_self_consistency(
&self,
record: &ProvenanceRecord,
) -> Result<VerificationResult>
pub fn verify_fact_provenance_self_consistency( &self, record: &ProvenanceRecord, ) -> Result<VerificationResult>
Integrity-only check: verifies the record’s signatures against the key
embedded in the record itself. This proves the record has not been
altered since signing, but says nothing about who signed it — a record
signed by any key passes. For authenticity use
ProvenanceManager::verify_fact_provenance with a trust anchor.
pub fn signing_key(&self) -> &SigningKey
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
This manager’s current verifying (public) key.
Sourcepub fn self_trust(&self) -> TrustStore
pub fn self_trust(&self) -> TrustStore
A trust store containing only this manager’s own key. Pass it to the verify methods to authenticate records this manager signed.
pub fn create_sigstore_bundle( &self, content: &[u8], identity: Option<&str>, ) -> Result<SigstoreBundle>
Sourcepub fn verify_sigstore_bundle(
&self,
bundle: &SigstoreBundle,
content: &[u8],
trusted_key: &VerifyingKey,
) -> Result<()>
pub fn verify_sigstore_bundle( &self, bundle: &SigstoreBundle, content: &[u8], trusted_key: &VerifyingKey, ) -> Result<()>
Verify a Sigstore bundle against a caller-supplied trusted key. The key
embedded in the bundle is ignored: authenticity comes from trusted_key,
not from the bundle itself.
Sourcepub fn create_cawg_assertion(
&self,
referenced: &[(String, String, Vec<u8>)],
display_name: &str,
) -> Result<Value>
pub fn create_cawg_assertion( &self, referenced: &[(String, String, Vec<u8>)], display_name: &str, ) -> Result<Value>
Create a CAWG ICA identity assertion. referenced is (url, alg, raw_hash) and
MUST include the hard binding. Returns the cawg.identity assertion JSON.
Sourcepub fn verify_cawg_assertion(
&self,
assertion: &Value,
trust: &TrustStore,
) -> Result<Value>
pub fn verify_cawg_assertion( &self, assertion: &Value, trust: &TrustStore, ) -> Result<Value>
Verify a cawg.identity ICA assertion JSON and require its issuer to be
trusted, returning the embedded VC. verify_cawg_ica only proves the
assertion is self-consistent (signed by the key its own VC names); the
trust anchor establishes that the issuing agent is one the caller
accepts. Rejects an assertion whose issuer DID is not in trust.
pub fn keri_event_log(&self) -> &RwLock<KeyEventLog>
pub fn create_keri_interaction(&self, anchors: Vec<Value>) -> Result<KeyEvent>
pub fn verify_keri_log(&self) -> Result<()>
Sourcepub fn verify_store_manifest(
&self,
manifest: &StoreManifest,
store_data: Option<&[u8]>,
trust: &TrustStore,
) -> Result<VerificationResult>
pub fn verify_store_manifest( &self, manifest: &StoreManifest, store_data: Option<&[u8]>, trust: &TrustStore, ) -> Result<VerificationResult>
Authenticity check for a store manifest: verifies its COSE signature and
optional store hash, and requires the signing key to be present in
trust. See ProvenanceManager::verify_fact_provenance for the
self-consistency vs. authenticity distinction.
Sourcepub fn verify_store_manifest_self_consistency(
&self,
manifest: &StoreManifest,
store_data: Option<&[u8]>,
) -> Result<VerificationResult>
pub fn verify_store_manifest_self_consistency( &self, manifest: &StoreManifest, store_data: Option<&[u8]>, ) -> Result<VerificationResult>
Integrity-only check for a store manifest: verifies signatures against the key embedded in the manifest. Does not establish authenticity.
Auto Trait Implementations§
impl !Freeze for ProvenanceManager
impl !RefUnwindSafe for ProvenanceManager
impl Send for ProvenanceManager
impl Sync for ProvenanceManager
impl Unpin for ProvenanceManager
impl UnsafeUnpin for ProvenanceManager
impl UnwindSafe for ProvenanceManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.