Struct ockam_identity::Identity
source · [−]pub struct Identity<V: IdentityVault> { /* private fields */ }
Expand description
Identity implementation
Implementations
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,
storage: &impl AuthenticatedStorage
) -> Result<()>
pub async fn create_secure_channel(
&self,
route: impl Into<Route>,
trust_policy: impl TrustPolicy,
storage: &impl AuthenticatedStorage
) -> Result<Address>
pub async fn create_secure_channel_extended(
&self,
route: impl Into<Route>,
trust_policy: impl TrustPolicy,
storage: &impl AuthenticatedStorage,
timeout: Duration
) -> Result<Address>
sourceimpl<V: IdentityVault> Identity<V>
impl<V: IdentityVault> Identity<V>
sourcepub fn new(
id: IdentityIdentifier,
change_history: IdentityChangeHistory,
ctx: Context,
vault: V,
rng: impl RngCore + CryptoRng + Clone
) -> Self
pub fn new(
id: IdentityIdentifier,
change_history: IdentityChangeHistory,
ctx: Context,
vault: V,
rng: impl RngCore + CryptoRng + Clone
) -> Self
Identity constructor
pub async fn export(&self) -> Result<Vec<u8>>
pub async fn import(ctx: &Context, data: &[u8], vault: &V) -> Result<Self>
pub async fn changes(&self) -> Result<IdentityChangeHistory>
pub fn vault(&self) -> &V
pub async fn verify_changes(&self) -> Result<bool>
sourceimpl<V: IdentityVault> Identity<V>
impl<V: IdentityVault> Identity<V>
pub fn identifier(&self) -> Result<IdentityIdentifier>
pub async fn create_key(&self, label: String) -> Result<()>
pub async fn add_key(&self, label: String, secret: &KeyId) -> Result<()>
pub async fn rotate_root_secret_key(&self) -> Result<()>
sourcepub async fn get_root_secret_key(&self) -> Result<KeyId>
pub async fn get_root_secret_key(&self) -> Result<KeyId>
Get [Secret
] key. Key is uniquely identified by label in KeyAttributes
pub async fn get_secret_key(&self, label: String) -> Result<KeyId>
pub async fn get_root_public_key(&self) -> Result<PublicKey>
pub async fn get_public_key(&self, label: String) -> Result<PublicKey>
sourcepub async fn create_signature(&self, data: &[u8]) -> Result<Signature>
pub async fn create_signature(&self, data: &[u8]) -> Result<Signature>
Generate Proof of possession of crate::Identity
.
channel_state should be tied to channel’s cryptographical material (e.g. h value for Noise XX)
sourcepub async fn verify_signature(
&self,
signature: &Signature,
their_identity_id: &IdentityIdentifier,
data: &[u8],
storage: &impl AuthenticatedStorage
) -> Result<bool>
pub async fn verify_signature(
&self,
signature: &Signature,
their_identity_id: &IdentityIdentifier,
data: &[u8],
storage: &impl AuthenticatedStorage
) -> Result<bool>
Verify Proof of possession of Identity
with given
IdentityIdentifier
. channel_state should be tied to channel’s
cryptographical material (e.g. h value for Noise XX)
pub async fn get_known_identity(
&self,
their_identity_id: &IdentityIdentifier,
storage: &impl AuthenticatedStorage
) -> Result<Option<IdentityChangeHistory>>
pub async fn update_known_identity(
&self,
their_identity_id: &IdentityIdentifier,
current_history: &IdentityChangeHistory,
storage: &impl AuthenticatedStorage
) -> Result<()>
Trait Implementations
sourceimpl<V: IdentityVault + Send + Sync + AsyncTryClone> AsyncTryClone for Identity<V>
impl<V: IdentityVault + Send + Sync + AsyncTryClone> AsyncTryClone for Identity<V>
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> where
V: Unpin,
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