Struct Identifier

Source
pub struct Identifier {
    pub known_events: Arc<KnownEvents>,
    pub to_notify: Vec<SignedEventMessage>,
    /* private fields */
}

Fields§

§known_events: Arc<KnownEvents>§to_notify: Vec<SignedEventMessage>

Implementations§

Source§

impl Identifier

Source

pub async fn broadcast_receipts( &mut self, dest_wit_ids: &[IdentifierPrefix], ) -> Result<(), BroadcastingError>

Send new receipts obtained via Self::finalize_query to specified witnesses. Returns number of new receipts sent per witness or first error.

Source§

impl Identifier

Source

pub fn delegate( &self, delegated_event: &KeriEvent<KeyEvent>, ) -> Result<(KeriEvent<KeyEvent>, ExchangeMessage), MechanicsError>

Generates delegating event (ixn) and exchange event that contains delegated event which will be send to delegate after ixn finalization.

Source§

impl Identifier

Source

pub fn incept_group( &self, participants: Vec<IdentifierPrefix>, signature_threshold: u64, next_keys_threshold: Option<u64>, initial_witness: Option<Vec<BasicPrefix>>, witness_threshold: Option<u64>, delegator: Option<IdentifierPrefix>, ) -> Result<(String, Vec<String>), MechanicsError>

Init group identifier

Returns serialized group icp and list of exchange messages to sign. Exchanges are meant to be send to witness and forwarded to group participants. If delegator parameter is provided, it will generate delegated inception and append delegation request to exchange messages.

Source

pub async fn finalize_group_incept( &mut self, group_event: &[u8], sig: SelfSigningPrefix, exchanges: Vec<(Vec<u8>, Signature)>, ) -> Result<IdentifierPrefix, MechanicsError>

Finalizes group identifier.

Source

pub async fn finalize_group_event( &mut self, group_event: &[u8], sig: SelfSigningPrefix, exchanges: Vec<(Vec<u8>, Signature)>, ) -> Result<(), MechanicsError>

Finalizes group event.

Source

pub async fn finalize_exchange( &self, exchange: &[u8], exn_signature: Signature, data_signature: IndexedSignature, ) -> Result<(), MechanicsError>

Source§

impl Identifier

Source

pub async fn rotate( &self, current_keys: Vec<BasicPrefix>, new_next_keys: Vec<BasicPrefix>, new_next_threshold: u64, witness_to_add: Vec<LocationScheme>, witness_to_remove: Vec<BasicPrefix>, witness_threshold: u64, ) -> Result<String, MechanicsError>

Generate and return rotation event for Identifier

Source

pub fn anchor( &self, payload: &[SelfAddressingIdentifier], ) -> Result<String, MechanicsError>

Generate and return interaction event for Identifier

Source

pub fn anchor_with_seal( &self, seal_list: &[Seal], ) -> Result<KeriEvent<KeyEvent>, MechanicsError>

Source

pub async fn finalize_rotate( &mut self, event: &[u8], sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source

pub async fn finalize_anchor( &mut self, event: &[u8], sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source

pub fn index_in_current_keys( &self, key_config: &KeyConfig, ) -> Result<usize, MechanicsError>

Source§

impl Identifier

Source

pub async fn notify_witnesses(&mut self) -> Result<usize, MechanicsError>

Source§

impl Identifier

Source

pub fn query_mailbox( &self, identifier: &IdentifierPrefix, witnesses: &[BasicPrefix], ) -> Result<Vec<MailboxQuery>, ControllerError>

Generates query message of route mbx to query own identifier mailbox.

Source

pub async fn finalize_query_mailbox( &mut self, queries: Vec<(MailboxQuery, SelfSigningPrefix)>, ) -> Result<Vec<ActionRequired>, ControllerError>

Joins query events with their signatures, sends it to witness and process its response. If user action is needed to finalize process, returns proper notification.

Source§

impl Identifier

Source

pub fn incept_registry( &mut self, ) -> Result<(IdentifierPrefix, TypedEvent<EventTypeTag, KeyEvent>), ControllerError>

Generate vcp event and ixn event with seal to vcp. To finalize the process, ixn need to be signed confirmed with finalize_event function.

Source

pub async fn finalize_incept_registry( &mut self, event: &[u8], sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source

pub async fn notify_backers(&self) -> Result<(), MechanicsError>

Source§

impl Identifier

Source

pub fn add_watcher( &self, watcher_id: IdentifierPrefix, ) -> Result<String, MechanicsError>

Generates reply event with end_role_add route.

Source

pub fn remove_watcher( &self, watcher_id: IdentifierPrefix, ) -> Result<String, MechanicsError>

Generates reply event with end_role_cut route.

Source

pub async fn finalize_add_watcher( &self, event: &[u8], sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source§

impl Identifier

Source

pub fn query_watchers( &self, about_who: &EventSeal, ) -> Result<Vec<QueryEvent>, ControllerError>

Source

pub async fn finalize_query( &self, queries: Vec<(QueryEvent, SelfSigningPrefix)>, ) -> (QueryResponse, Vec<WatcherResponseError>)

Joins query events with their signatures, sends it to recipient and process its response. Returns a tuple containing two elements: 1. A notification if any identifier’s KEL (Key Event Log) was updated. 2. A list of errors that occurred either during sending or on the recipient side.

Source

pub fn query_full_log( &self, id: &IdentifierPrefix, watcher: IdentifierPrefix, ) -> Result<QueryEvent, ControllerError>

Source§

impl Identifier

Source

pub fn sign_with_index( &self, signature: SelfSigningPrefix, key_index: u16, ) -> Result<Signature, ControllerError>

Source

pub fn sign_data( &self, data: &[u8], signatures: &[SelfSigningPrefix], ) -> Result<Signature, ControllerError>

Source

pub fn sign_to_cesr( &self, data: &str, signatures: &[SelfSigningPrefix], ) -> Result<String, ControllerError>

Source

pub fn sign_with_index_to_cesr( &self, data: &str, signature: SelfSigningPrefix, key_index: u16, ) -> Result<String, ControllerError>

Source

pub fn verify_from_cesr(&self, stream: &[u8]) -> Result<(), ControllerError>

Source§

impl Identifier

Source

pub fn issue( &self, credential_digest: SelfAddressingIdentifier, ) -> Result<(IdentifierPrefix, TypedEvent<EventTypeTag, KeyEvent>), ControllerError>

Generate iss event and ixn event with seal to iss. To finalize the process, ixn need to be signed confirmed with finalize_event function.

Source

pub fn revoke( &self, credential_sai: &SelfAddressingIdentifier, ) -> Result<Vec<u8>, ControllerError>

Generate rev event and ixn event with seal to rev. To finalize the process, ixn need to be signed confirmed with finalize_event function.

Source

pub async fn finalize_issue( &mut self, event: &[u8], sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source

pub async fn finalize_revoke( &mut self, event: &[u8], sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source

pub fn query_tel( &self, registry_id: IdentifierPrefix, vc_identifier: IdentifierPrefix, ) -> Result<TelQueryEvent, ControllerError>

Source

pub async fn finalize_query_tel( &self, qry: TelQueryEvent, sig: SelfSigningPrefix, ) -> Result<(), MechanicsError>

Source§

impl Identifier

Source

pub fn new( id: IdentifierPrefix, registry_id: Option<IdentifierPrefix>, known_events: Arc<KnownEvents>, communication: Arc<Communication>, ) -> Self

Source

pub async fn resolve_oobi(&self, oobi: &Oobi) -> Result<(), MechanicsError>

Source

pub async fn send_oobi_to_watcher( &self, id: &IdentifierPrefix, oobi: &Oobi, ) -> Result<(), ControllerError>

Source

pub fn id(&self) -> &IdentifierPrefix

Source

pub fn registry_id(&self) -> Option<&IdentifierPrefix>

Source

pub fn find_state( &self, id: &IdentifierPrefix, ) -> Result<IdentifierState, MechanicsError>

Returns accepted IdentifierState of identifier.

Source

pub fn find_management_tel_state( &self, id: &IdentifierPrefix, ) -> Result<Option<ManagerTelState>, ControllerError>

Source

pub fn find_vc_state( &self, vc_hash: &SelfAddressingIdentifier, ) -> Result<Option<TelState>, ControllerError>

Source

pub fn current_public_keys(&self) -> Result<Vec<BasicPrefix>, ControllerError>

Source

pub fn witnesses(&self) -> impl Iterator<Item = BasicPrefix>

Source

pub fn watchers(&self) -> Result<Vec<IdentifierPrefix>, ControllerError>

Source

pub fn get_own_kel(&self) -> Option<Vec<Notice>>

Returns own identifier accepted Key Event Log

Source

pub fn get_kel(&self, id: &IdentifierPrefix) -> Option<Vec<Notice>>

Returns identifier accepted Key Event Log

Source

pub fn get_last_establishment_event_seal( &self, ) -> Result<EventSeal, ControllerError>

Source

pub fn get_last_event_seal(&self) -> Result<EventSeal, MechanicsError>

Source§

impl Identifier

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,