Trait ockam_entity::Identity [−][src]
pub trait Identity: AsyncTryClone + Send + Sync + 'static {
Show 20 methods
fn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ProfileIdentifier>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn create_key<'life0, 'async_trait>(
&'life0 mut self,
label: String
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn rotate_profile_key<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_profile_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_secret_key<'life0, 'async_trait>(
&'life0 self,
label: String
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_profile_public_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_public_key<'life0, 'async_trait>(
&'life0 self,
label: String
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn create_auth_proof<'life0, 'life1, 'async_trait>(
&'life0 mut self,
state_slice: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<AuthenticationProof>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn verify_auth_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
state_slice: &'life1 [u8],
peer_id: &'life2 ProfileIdentifier,
proof_slice: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
fn add_change<'life0, 'async_trait>(
&'life0 mut self,
change_event: ProfileChangeEvent
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_changes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Changes>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn verify_changes<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_contacts<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Contact>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn as_contact<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Contact>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn get_contact<'life0, 'life1, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 ProfileIdentifier
) -> Pin<Box<dyn Future<Output = Result<Option<Contact>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn verify_contact<'life0, 'async_trait>(
&'life0 mut self,
contact: Contact
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn verify_and_add_contact<'life0, 'async_trait>(
&'life0 mut self,
contact: Contact
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn verify_and_update_contact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 ProfileIdentifier,
change_events: &'life2 [ProfileChangeEvent]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn get_lease<'life0, 'life1, 'async_trait>(
&'life0 self,
lease_manager_route: &'life1 Route,
org_id: String,
bucket: String,
ttl: TTL
) -> Pin<Box<dyn Future<Output = Result<Lease>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn revoke_lease<'life0, 'life1, 'async_trait>(
&'life0 mut self,
lease_manager_route: &'life1 Route,
lease: Lease
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}
Expand description
Identity
Required methods
fn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ProfileIdentifier>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ProfileIdentifier>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Return unique Profile
identifier, which is equal to sha256 of the root public key
Create new key.
Rotate existing key.
Get Secret
key.
Get Secret
key.
Get PublicKey
.
Get PublicKey
.
Create an authentication proof based on the given state
fn verify_auth_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
state_slice: &'life1 [u8],
peer_id: &'life2 ProfileIdentifier,
proof_slice: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn verify_auth_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
state_slice: &'life1 [u8],
peer_id: &'life2 ProfileIdentifier,
proof_slice: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Verify a proof based on the given state, proof and profile.
fn add_change<'life0, 'async_trait>(
&'life0 mut self,
change_event: ProfileChangeEvent
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn add_change<'life0, 'async_trait>(
&'life0 mut self,
change_event: ProfileChangeEvent
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Add a change event.
Return change history chain
Verify the whole change event chain
Return all known to this profile Contact
s
fn get_contact<'life0, 'life1, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 ProfileIdentifier
) -> Pin<Box<dyn Future<Output = Result<Option<Contact>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_contact<'life0, 'life1, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 ProfileIdentifier
) -> Pin<Box<dyn Future<Output = Result<Option<Contact>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Return Contact
with given ProfileIdentifier
Verify cryptographically whole event chain. Also verify sequence correctness
fn verify_and_update_contact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 ProfileIdentifier,
change_events: &'life2 [ProfileChangeEvent]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn verify_and_update_contact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
contact_id: &'life1 ProfileIdentifier,
change_events: &'life2 [ProfileChangeEvent]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Verify and update known Contact
with new ProfileChangeEvent
s