Struct ockam_entity::Contact
source · [−]pub struct Contact { /* private fields */ }
Expand description
Contact is an abstraction responsible for storing user’s public data (mainly - public keys).
It is designed to share users’ public keys in cryptographically verifiable way.
Public keys together with metadata are organised into verifiable events chain exactly like crate::Profile
.
There are two ways to get Contact:
- From another user (in this case Contact will be cryptographically verified)
- Generate one from user’s own
Profile
Public keys from Contact can be used for many purposes, e.g. running key exchange, or signing&encrypting data.
Examples
TODO
Implementations
Return unique identifier, which equals to Profile
’s identifier
Return change history chain
Create a new Contact.
Verify cryptographically whole event chain. Also verify sequence correctness
pub async fn verify_and_update<C: AsRef<[ProfileChangeEvent]>>(
&mut self,
change_events: C,
vault: &mut impl ProfileVault
) -> Result<bool>
pub async fn verify_and_update<C: AsRef<[ProfileChangeEvent]>>(
&mut self,
change_events: C,
vault: &mut impl ProfileVault
) -> Result<bool>
Update Contact
by using new change events
Get crate::Profile
Update PublicKey
Get PublicKey
. Key is uniquely identified by the specified label.
Get EventIdentifier
of the last known event
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Contact
impl UnwindSafe for Contact
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more