pub struct IdentityKey { /* private fields */ }Expand description
A public key that represents the identity of a user.
Wrapper for PublicKey.
Implementations§
Source§impl IdentityKey
impl IdentityKey
Sourcepub fn new(public_key: PublicKey) -> IdentityKey
pub fn new(public_key: PublicKey) -> IdentityKey
Initialize a public-facing identity from a public key.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Return the public key representing this identity.
Sourcepub fn serialize(&self) -> Box<[u8]>
pub fn serialize(&self) -> Box<[u8]>
Return an owned byte slice which can be deserialized with Self::decode.
Sourcepub fn decode(value: &[u8]) -> Result<IdentityKey, SignalProtocolError>
pub fn decode(value: &[u8]) -> Result<IdentityKey, SignalProtocolError>
Deserialize a public identity from a byte slice.
Sourcepub fn verify_alternate_identity(
&self,
other: &IdentityKey,
signature: &[u8],
) -> Result<bool, SignalProtocolError>
pub fn verify_alternate_identity( &self, other: &IdentityKey, signature: &[u8], ) -> Result<bool, SignalProtocolError>
Given a trusted identity self, verify that other represents an alternate identity for
this user.
signature must be calculated from IdentityKeyPair::sign_alternate_identity.
Trait Implementations§
Source§impl Clone for IdentityKey
impl Clone for IdentityKey
Source§fn clone(&self) -> IdentityKey
fn clone(&self) -> IdentityKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdentityKey
impl Debug for IdentityKey
Source§impl From<IdentityKey> for PublicKey
impl From<IdentityKey> for PublicKey
Source§fn from(value: IdentityKey) -> PublicKey
fn from(value: IdentityKey) -> PublicKey
Converts to this type from the input type.
Source§impl From<PublicKey> for IdentityKey
impl From<PublicKey> for IdentityKey
Source§fn from(value: PublicKey) -> IdentityKey
fn from(value: PublicKey) -> IdentityKey
Converts to this type from the input type.
Source§impl PartialEq for IdentityKey
impl PartialEq for IdentityKey
Source§impl TryFrom<&[u8]> for IdentityKey
impl TryFrom<&[u8]> for IdentityKey
Source§type Error = SignalProtocolError
type Error = SignalProtocolError
The type returned in the event of a conversion error.
Source§fn try_from(value: &[u8]) -> Result<IdentityKey, SignalProtocolError>
fn try_from(value: &[u8]) -> Result<IdentityKey, SignalProtocolError>
Performs the conversion.
impl Copy for IdentityKey
impl Eq for IdentityKey
impl StructuralPartialEq for IdentityKey
Auto Trait Implementations§
impl Freeze for IdentityKey
impl RefUnwindSafe for IdentityKey
impl Send for IdentityKey
impl Sync for IdentityKey
impl Unpin for IdentityKey
impl UnwindSafe for IdentityKey
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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].