Struct libsignal_protocol::KeyPair
source · pub struct KeyPair {
pub public_key: PublicKey,
pub private_key: PrivateKey,
}
Fields§
§public_key: PublicKey
§private_key: PrivateKey
Implementations§
source§impl KeyPair
impl KeyPair
pub fn generate<R: Rng + CryptoRng>(csprng: &mut R) -> Self
pub fn new(public_key: PublicKey, private_key: PrivateKey) -> Self
pub fn from_public_and_private( public_key: &[u8], private_key: &[u8], ) -> Result<Self>
pub fn calculate_signature<R: CryptoRng + Rng>( &self, message: &[u8], csprng: &mut R, ) -> Result<Box<[u8]>>
pub fn calculate_agreement(&self, their_key: &PublicKey) -> Result<Box<[u8]>>
Trait Implementations§
source§impl From<IdentityKeyPair> for KeyPair
impl From<IdentityKeyPair> for KeyPair
source§fn from(value: IdentityKeyPair) -> Self
fn from(value: IdentityKeyPair) -> Self
Converts to this type from the input type.
source§impl From<KeyPair> for IdentityKeyPair
impl From<KeyPair> for IdentityKeyPair
source§impl TryFrom<PrivateKey> for KeyPair
impl TryFrom<PrivateKey> for KeyPair
§type Error = SignalProtocolError
type Error = SignalProtocolError
The type returned in the event of a conversion error.
source§fn try_from(value: PrivateKey) -> Result<Self>
fn try_from(value: PrivateKey) -> Result<Self>
Performs the conversion.
impl Copy for KeyPair
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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
)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