Struct keri_controller::Controller
source · pub struct Controller {
pub storage: Arc<EventStorage>,
pub oobi_manager: OobiManager,
pub tel: Arc<Tel>,
/* private fields */
}Fields§
§storage: Arc<EventStorage>§oobi_manager: OobiManager§tel: Arc<Tel>Implementations§
source§impl Controller
impl Controller
pub async fn resolve_oobi(&self, oobi: Oobi) -> Result<(), ControllerError>
pub fn get_messagebox_location( &self, id: &IdentifierPrefix ) -> Result<Vec<LocationScheme>, ControllerError>
pub fn get_messagebox_end_role( &self, id: &IdentifierPrefix ) -> Result<Vec<EndRole>, ControllerError>
source§impl Controller
impl Controller
sourcepub fn parse_cesr_stream(
&self,
stream: &str
) -> Result<(Vec<Oobi>, Vec<ParsedData>), ControllerError>
pub fn parse_cesr_stream( &self, stream: &str ) -> Result<(Vec<Oobi>, Vec<ParsedData>), ControllerError>
Parse elements from cesr stream and splits them into oobis to be resolved and signed credentials.
pub fn verify( &self, data: &[u8], signature: &Signature ) -> Result<(), ControllerError>
pub fn verify_from_cesr(&self, stream: &str) -> Result<(), ControllerError>
sourcepub fn verify_parsed(&self, data: &[ParsedData]) -> Result<(), ControllerError>
pub fn verify_parsed(&self, data: &[ParsedData]) -> Result<(), ControllerError>
Verify signed data that was parsed from cesr stream.
source§impl Controller
impl Controller
pub fn new(config: ControllerConfig) -> Result<Self, ControllerError>
sourcepub async fn resolve_loc_schema(
&self,
lc: &LocationScheme
) -> Result<(), ControllerError>
pub async fn resolve_loc_schema( &self, lc: &LocationScheme ) -> Result<(), ControllerError>
Make http request to get identifier’s endpoints information.
pub fn get_watchers( &self, id: &IdentifierPrefix ) -> Result<Vec<IdentifierPrefix>, ControllerError>
sourcepub async fn send_oobi_to_watcher(
&self,
id: &IdentifierPrefix,
oobi: &Oobi
) -> Result<(), ControllerError>
pub async fn send_oobi_to_watcher( &self, id: &IdentifierPrefix, oobi: &Oobi ) -> Result<(), ControllerError>
Sends identifier’s endpoint information to identifiers’s watchers.
pub fn process( &self, msg: &Message ) -> Result<Option<Vec<Message>>, ControllerError>
sourcepub fn process_stream(&self, stream: &[u8]) -> Result<(), ControllerError>
pub fn process_stream(&self, stream: &[u8]) -> Result<(), ControllerError>
Parse and process events stream
sourcepub fn get_loc_schemas(
&self,
id: &IdentifierPrefix
) -> Result<Vec<LocationScheme>, ControllerError>
pub fn get_loc_schemas( &self, id: &IdentifierPrefix ) -> Result<Vec<LocationScheme>, ControllerError>
Returns identifier contact information.
pub async fn incept( &self, public_keys: Vec<BasicPrefix>, next_pub_keys: Vec<BasicPrefix>, witnesses: Vec<LocationScheme>, witness_threshold: u64 ) -> Result<String, ControllerError>
sourcepub async fn finalize_inception(
&self,
event: &[u8],
sig: &SelfSigningPrefix
) -> Result<IdentifierPrefix, ControllerError>
pub async fn finalize_inception( &self, event: &[u8], sig: &SelfSigningPrefix ) -> Result<IdentifierPrefix, ControllerError>
Verifies event signature and adds it to kel.
Returns new established identifier prefix.
Meant to be used for identifiers with one key pair.
Must call IdentifierController::notify_witnesses after calling this function.
sourcepub async fn rotate(
&self,
id: IdentifierPrefix,
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 async fn rotate( &self, id: IdentifierPrefix, 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>
Generate and return rotation event for given identifier data
sourcepub fn anchor(
&self,
id: IdentifierPrefix,
payload: &[SelfAddressingIdentifier]
) -> Result<String, ControllerError>
pub fn anchor( &self, id: IdentifierPrefix, payload: &[SelfAddressingIdentifier] ) -> Result<String, ControllerError>
Generate and return interaction event for given identifier data
sourcepub fn anchor_with_seal(
&self,
id: &IdentifierPrefix,
payload: &[Seal]
) -> Result<KeriEvent<KeyEvent>, ControllerError>
pub fn anchor_with_seal( &self, id: &IdentifierPrefix, payload: &[Seal] ) -> Result<KeriEvent<KeyEvent>, ControllerError>
Generate and return interaction event for given identifier data
pub fn get_witnesses_at_event( &self, event_message: &KeriEvent<KeyEvent> ) -> Result<Vec<BasicPrefix>, ControllerError>
pub fn get_state( &self, id: &IdentifierPrefix ) -> Result<IdentifierState, ControllerError>
Auto Trait Implementations§
impl !RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl !UnwindSafe for Controller
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more