Struct libsignal_protocol::IdentityKey
source · 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) -> Self
pub fn new(public_key: PublicKey) -> Self
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 verify_alternate_identity(
&self,
other: &IdentityKey,
signature: &[u8],
) -> Result<bool>
pub fn verify_alternate_identity( &self, other: &IdentityKey, signature: &[u8], ) -> Result<bool>
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 copy 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) -> Self
fn from(value: IdentityKey) -> Self
Converts to this type from the input type.
source§impl From<PublicKey> for IdentityKey
impl From<PublicKey> for IdentityKey
source§impl Ord for IdentityKey
impl Ord for IdentityKey
source§fn cmp(&self, other: &IdentityKey) -> Ordering
fn cmp(&self, other: &IdentityKey) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for IdentityKey
impl PartialEq for IdentityKey
source§fn eq(&self, other: &IdentityKey) -> bool
fn eq(&self, other: &IdentityKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for IdentityKey
impl PartialOrd for IdentityKey
source§fn partial_cmp(&self, other: &IdentityKey) -> Option<Ordering>
fn partial_cmp(&self, other: &IdentityKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<&[u8]> for IdentityKey
impl TryFrom<&[u8]> for IdentityKey
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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.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