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
impl Identifier
sourcepub async fn broadcast_receipts(
&mut self,
dest_wit_ids: &[IdentifierPrefix]
) -> Result<usize, ControllerError>
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
impl Identifier
sourcepub fn delegate(
&self,
delegated_event: &KeriEvent<KeyEvent>
) -> Result<(KeriEvent<KeyEvent>, ExchangeMessage), ControllerError>
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
impl Identifier
sourcepub 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>
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.
sourcepub async fn finalize_group_incept(
&mut self,
group_event: &[u8],
sig: SelfSigningPrefix,
exchanges: Vec<(Vec<u8>, SelfSigningPrefix)>
) -> Result<IdentifierPrefix, ControllerError>
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.
pub async fn finalize_exchange( &self, exchange: &[u8], exn_signature: SelfSigningPrefix, data_signature: IndexedSignature ) -> Result<(), ControllerError>
source§impl Identifier
impl Identifier
sourcepub 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>
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
sourcepub fn anchor(
&self,
payload: &[SelfAddressingIdentifier]
) -> Result<String, ControllerError>
pub fn anchor( &self, payload: &[SelfAddressingIdentifier] ) -> Result<String, ControllerError>
Generate and return interaction event for Identifier
pub fn anchor_with_seal( &self, seal_list: &[Seal] ) -> Result<KeriEvent<KeyEvent>, ControllerError>
sourcepub fn add_watcher(
&self,
watcher_id: IdentifierPrefix
) -> Result<String, ControllerError>
pub fn add_watcher( &self, watcher_id: IdentifierPrefix ) -> Result<String, ControllerError>
Generates reply event with end_role_add route.
sourcepub fn remove_watcher(
&self,
watcher_id: IdentifierPrefix
) -> Result<String, ControllerError>
pub fn remove_watcher( &self, watcher_id: IdentifierPrefix ) -> Result<String, ControllerError>
Generates reply event with end_role_cut route.
sourcepub async fn finalize_event(
&mut self,
event: &[u8],
sig: SelfSigningPrefix
) -> Result<(), ControllerError>
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
impl Identifier
pub fn process_receipt( &self, receipt: &SignedNontransferableReceipt ) -> Result<(), ControllerError>
pub fn process_own_mailbox( &self, mb: &MailboxResponse ) -> Result<Vec<ActionRequired>, ControllerError>
pub async fn process_groups_mailbox( &self, groups: Vec<IdentifierPrefix>, mb: &MailboxResponse ) -> Result<Vec<ActionRequired>, ControllerError>
pub async fn process_group_mailbox( &self, mb: &MailboxResponse, group_id: &IdentifierPrefix ) -> Result<Vec<ActionRequired>, ControllerError>
source§impl Identifier
impl Identifier
pub async fn notify_witnesses(&mut self) -> Result<usize, ControllerError>
source§impl Identifier
impl Identifier
sourcepub fn query_mailbox(
&self,
identifier: &IdentifierPrefix,
witnesses: &[BasicPrefix]
) -> Result<Vec<QueryEvent>, ControllerError>
pub fn query_mailbox( &self, identifier: &IdentifierPrefix, witnesses: &[BasicPrefix] ) -> Result<Vec<QueryEvent>, ControllerError>
Generates query message of route mbx to query own identifier mailbox.
pub fn query_own_watchers( &self, about_who: &EventSeal ) -> Result<Vec<QueryEvent>, ControllerError>
sourcepub async fn finalize_query(
&self,
queries: Vec<(QueryEvent, SelfSigningPrefix)>
) -> Result<Vec<ActionRequired>, ControllerError>
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
impl Identifier
pub fn sign_with_index( &self, signature: SelfSigningPrefix, key_index: u16 ) -> Result<Signature, ControllerError>
pub fn sign_data( &self, data: &[u8], signatures: &[SelfSigningPrefix] ) -> Result<Signature, ControllerError>
pub fn sign_to_cesr( &self, data: &str, signatures: &[SelfSigningPrefix] ) -> Result<String, ControllerError>
pub fn sign_with_index_to_cesr( &self, data: &str, signature: SelfSigningPrefix, key_index: u16 ) -> Result<String, ControllerError>
source§impl Identifier
impl Identifier
sourcepub fn incept_registry(
&mut self
) -> Result<(IdentifierPrefix, Vec<u8>), ControllerError>
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.
sourcepub fn issue(
&self,
credential_digest: SelfAddressingIdentifier
) -> Result<(IdentifierPrefix, Vec<u8>), ControllerError>
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.
sourcepub fn revoke(
&self,
credential_sai: &SelfAddressingIdentifier
) -> Result<Vec<u8>, ControllerError>
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.
pub fn query_tel( &self, registry_id: IdentifierPrefix, vc_identifier: IdentifierPrefix ) -> Result<TelQueryEvent, ControllerError>
pub async fn finalize_tel_query( &self, issuer_id: &IdentifierPrefix, qry: TelQueryEvent, sig: SelfSigningPrefix ) -> Result<(), ControllerError>
pub async fn notify_backers(&self) -> Result<(), ControllerError>
source§impl Identifier
impl Identifier
pub fn new( id: IdentifierPrefix, known_events: Arc<KnownEvents>, communication: Arc<Communication> ) -> Self
pub async fn resolve_oobi(&self, oobi: &Oobi) -> Result<(), ControllerError>
pub async fn send_oobi_to_watcher( &self, id: &IdentifierPrefix, oobi: &Oobi ) -> Result<(), ControllerError>
pub fn id(&self) -> &IdentifierPrefix
pub fn registry_id(&self) -> Option<&IdentifierPrefix>
sourcepub fn find_state(
&self,
id: &IdentifierPrefix
) -> Result<IdentifierState, ControllerError>
pub fn find_state( &self, id: &IdentifierPrefix ) -> Result<IdentifierState, ControllerError>
Returns accepted IdentifierState of identifier.