pub struct IdentifierController {
pub id: IdentifierPrefix,
pub source: Arc<Controller>,
pub registry_id: Option<IdentifierPrefix>,
/* private fields */
}Fields§
§id: IdentifierPrefix§source: Arc<Controller>§registry_id: Option<IdentifierPrefix>Implementations§
source§impl IdentifierController
impl IdentifierController
pub fn sign( &self, signature: SelfSigningPrefix, key_index: u16 ) -> Result<Signature, ControllerError>
pub fn to_cesr_signature( &self, sig: SelfSigningPrefix, index: u16 ) -> Result<String, ControllerError>
pub fn sign_to_cesr( &self, data: &str, signature: SelfSigningPrefix, key_index: u16 ) -> Result<String, ControllerError>
source§impl IdentifierController
impl IdentifierController
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 notify_backers(&self) -> Result<(), ControllerError>
source§impl IdentifierController
impl IdentifierController
pub fn new( id: IdentifierPrefix, kel: Arc<Controller>, registry_id: Option<IdentifierPrefix> ) -> Self
pub fn get_kel(&self) -> Result<String, ControllerError>
pub fn get_last_establishment_event_seal( &self ) -> Result<EventSeal, ControllerError>
pub async fn rotate( &self, current_keys: Vec<BasicPrefix>, new_next_keys: Vec<BasicPrefix>, witness_to_add: Vec<LocationScheme>, witness_to_remove: Vec<BasicPrefix>, witness_threshold: u64 ) -> Result<String, ControllerError>
pub fn anchor( &self, payload: &[SelfAddressingIdentifier] ) -> Result<String, ControllerError>
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.
pub fn anchor_with_seal( &self, seal_list: &[Seal] ) -> Result<KeriEvent<KeyEvent>, ControllerError>
pub fn anchor_group( &self, group_id: &IdentifierPrefix, 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 fn add_messagebox(
&self,
message_box_id: IdentifierPrefix
) -> Result<String, ControllerError>
pub fn add_messagebox( &self, message_box_id: IdentifierPrefix ) -> Result<String, ControllerError>
Generates reply event with end_role_add route and messagebox as a role..
sourcepub async fn finalize_event(
&self,
event: &[u8],
sig: SelfSigningPrefix
) -> Result<(), ControllerError>
pub async fn finalize_event( &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.
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.
pub async fn finalize_exchange( &self, exchange: &[u8], exn_signature: SelfSigningPrefix, data_signature: IndexedSignature ) -> Result<(), ControllerError>
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 notify_witnesses(&self) -> Result<usize, ControllerError>
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_watcher( &self, identifier: &IdentifierPrefix, watcher: IdentifierPrefix ) -> Result<QueryEvent, ControllerError>
pub fn query_own_watchers( &self, about_who: &IdentifierPrefix ) -> 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.
pub async fn finalize_tel_query( &self, issuer_id: &IdentifierPrefix, qry: TelQueryEvent, sig: SelfSigningPrefix ) -> Result<(), ControllerError>
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.
sourcepub async fn verify_stream(&self, stream: &str) -> Result<(), ControllerError>
pub async fn verify_stream(&self, stream: &str) -> Result<(), ControllerError>
Splits input string into oobis to resolve and signed data, sends oobi to watchers and verify provided credentials.