Struct keri_controller::identifier::Identifier

source ·
pub struct Identifier {
    pub to_notify: Vec<SignedEventMessage>,
    /* private fields */
}

Fields§

§to_notify: Vec<SignedEventMessage>

Implementations§

source§

impl Identifier

source

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

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), ControllerError>

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, initial_witness: Option<Vec<BasicPrefix>>, witness_threshold: Option<u64>, delegator: Option<IdentifierPrefix> ) -> Result<(String, Vec<String>), ControllerError>

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>, SelfSigningPrefix)> ) -> Result<IdentifierPrefix, ControllerError>

Finalizes group identifier. Joins event with signature and verifies them. Must call [IdentifierController::notify_witnesses] after calling this function to send signed exn messages to witness to be forwarded to group participants.

source

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

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, ControllerError>

Generate and return rotation event for Identifier

source

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

Generate and return interaction event for Identifier

source

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

source

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

Generates reply event with end_role_add route.

source

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

Generates reply event with end_role_cut route.

source

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

Checks signatures and updates database. Must call [IdentifierController::notify_witnesses] after calling this function if event is a key event.

source§

impl Identifier

source§

impl Identifier

source

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

source§

impl Identifier

source

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

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

source

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

source

pub async fn finalize_query( &self, queries: Vec<(QueryEvent, 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 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§

impl Identifier

source

pub fn incept_registry( &mut self ) -> Result<(IdentifierPrefix, Vec<u8>), 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 fn issue( &self, credential_digest: SelfAddressingIdentifier ) -> Result<(IdentifierPrefix, Vec<u8>), 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 fn query_tel( &self, registry_id: IdentifierPrefix, vc_identifier: IdentifierPrefix ) -> Result<TelQueryEvent, ControllerError>

source

pub async fn finalize_tel_query( &self, issuer_id: &IdentifierPrefix, qry: TelQueryEvent, sig: SelfSigningPrefix ) -> Result<(), ControllerError>

source

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

source§

impl Identifier

source

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

source

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

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, ControllerError>

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) -> Vec<BasicPrefix>

source

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

source

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

Returns own 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, ControllerError>

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

source§

const ALIGN: usize = _

The alignment of pointer.
§

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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