Struct ockam_identity::Identity
source · [−]pub struct Identity<V: IdentityVault> { /* private fields */ }
Implementations
sourceimpl<V: IdentityVault> Identity<V>
impl<V: IdentityVault> Identity<V>
sourceimpl<V: IdentityVault> Identity<V>
impl<V: IdentityVault> Identity<V>
pub async fn create_secure_channel_listener(
&self,
address: impl Into<Address>,
trust_policy: impl TrustPolicy
) -> Result<()>
pub async fn create_secure_channel(
&self,
route: impl Into<Route>,
trust_policy: impl TrustPolicy
) -> Result<Address>
pub async fn create_secure_channel_extended(
&mut self,
route: impl Into<Route>,
trust_policy: impl TrustPolicy,
timeout: Duration
) -> Result<Address>
Trait Implementations
sourceimpl<V: IdentityVault + Send + Sync> AsyncTryClone for Identity<V> where
Arc<RwLock<IdentityState<V>>>: AsyncTryClone,
impl<V: IdentityVault + Send + Sync> AsyncTryClone for Identity<V> where
Arc<RwLock<IdentityState<V>>>: AsyncTryClone,
sourceimpl<V: IdentityVault> IdentityTrait for Identity<V>
impl<V: IdentityVault> IdentityTrait for Identity<V>
sourcefn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<IdentityIdentifier>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn identifier<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<IdentityIdentifier>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Return unique Identity
identifier, which is equal to sha256 of the root public key
sourcefn create_key<'life0, 'async_trait>(
&'life0 self,
label: String
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn create_key<'life0, 'async_trait>(
&'life0 self,
label: String
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create new key.
sourcefn add_key<'life0, 'life1, 'async_trait>(
&'life0 self,
label: String,
secret: &'life1 KeyId
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn add_key<'life0, 'life1, 'async_trait>(
&'life0 self,
label: String,
secret: &'life1 KeyId
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Add key that already exists in current Vault
sourcefn rotate_root_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn rotate_root_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Rotate existing key.
sourcefn get_root_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<KeyId>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_root_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<KeyId>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get [Secret
] key.
sourcefn get_secret_key<'life0, 'async_trait>(
&'life0 self,
label: String
) -> Pin<Box<dyn Future<Output = Result<KeyId>> + 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<KeyId>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get [Secret
] key.
sourcefn get_root_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_root_public_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get PublicKey
.
sourcefn 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 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,
Get PublicKey
.
sourcefn create_auth_proof<'life0, 'life1, 'async_trait>(
&'life0 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 create_auth_proof<'life0, 'life1, 'async_trait>(
&'life0 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,
Create an authentication proof based on the given state
sourcefn verify_auth_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state_slice: &'life1 [u8],
peer_id: &'life2 IdentityIdentifier,
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 self,
state_slice: &'life1 [u8],
peer_id: &'life2 IdentityIdentifier,
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 identity.
sourcefn add_change<'life0, 'async_trait>(
&'life0 self,
change_event: IdentityChangeEvent
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn add_change<'life0, 'async_trait>(
&'life0 self,
change_event: IdentityChangeEvent
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Add a change event.
sourcefn 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 get_changes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Changes>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Return change history chain
sourcefn verify_changes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn verify_changes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Verify the whole change event chain
sourcefn 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 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,
Return all known to this identity Contact
s
sourcefn as_contact<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Contact>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn as_contact<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Contact>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
sourcefn get_contact<'life0, 'life1, 'async_trait>(
&'life0 self,
contact_id: &'life1 IdentityIdentifier
) -> 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 self,
contact_id: &'life1 IdentityIdentifier
) -> 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 IdentityIdentifier
sourcefn verify_contact<'life0, 'async_trait>(
&'life0 self,
contact: Contact
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn verify_contact<'life0, 'async_trait>(
&'life0 self,
contact: Contact
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Verify cryptographically whole event chain. Also verify sequence correctness
sourcefn verify_and_add_contact<'life0, 'async_trait>(
&'life0 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 self,
contact: Contact
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
sourcefn verify_and_update_contact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
identity_id: &'life1 IdentityIdentifier,
changes: &'life2 [IdentityChangeEvent]
) -> 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 self,
identity_id: &'life1 IdentityIdentifier,
changes: &'life2 [IdentityChangeEvent]
) -> 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 IdentityChangeEvent
s
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 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,
Auto Trait Implementations
impl<V> !RefUnwindSafe for Identity<V>
impl<V> Send for Identity<V>
impl<V> Sync for Identity<V>
impl<V> Unpin for Identity<V>
impl<V> !UnwindSafe for Identity<V>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more