Skip to main content

ProvenanceManager

Struct ProvenanceManager 

Source
pub struct ProvenanceManager { /* private fields */ }

Implementations§

Source§

impl ProvenanceManager

Source

pub fn new(key_path: &Path, storage_path: Option<&Path>) -> Result<Self>

Source

pub fn from_signing_key(signing_key: SigningKey) -> Self

Source

pub fn issuer_did(&self) -> &str

Source

pub fn store_record(&self, fact_id: &str, record: ProvenanceRecord)

Source

pub fn get_record(&self, fact_id: &str) -> Option<ProvenanceRecord>

Source

pub fn record_count(&self) -> usize

Source

pub fn record_deletion( &self, fact_id: &str, reason: Option<&str>, ) -> Result<DeletionRecord>

Source

pub fn rotate_key(&mut self, new_key_path: &Path) -> Result<String>

Source

pub fn verify_log_integrity(&self) -> Result<bool>

Source

pub fn revoke_credential(&self, status_index: u64) -> Result<()>

Source

pub fn is_revoked(&self, status_index: u64) -> bool

Source

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.

Source

pub fn create_triple_provenance( &self, params: &TripleProvenanceParams<'_>, ) -> Result<ProvenanceRecord>

Create a full provenance record for a stored triple.

Source

pub fn create_batch_provenance( &self, items: &[(&str, &[u8], Option<&str>)], ) -> Result<Vec<ProvenanceRecord>>

Source

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.

Source

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.

Source

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.

Source

pub fn signing_key(&self) -> &SigningKey

Source

pub fn verifying_key(&self) -> VerifyingKey

This manager’s current verifying (public) key.

Source

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.

Source

pub fn create_sigstore_bundle( &self, content: &[u8], identity: Option<&str>, ) -> Result<SigstoreBundle>

Source

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.

Source

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.

Source

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.

Source

pub fn keri_event_log(&self) -> &RwLock<KeyEventLog>

Source

pub fn create_keri_interaction(&self, anchors: Vec<Value>) -> Result<KeyEvent>

Source

pub fn verify_keri_log(&self) -> Result<()>

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more