pub struct AgreementPublicKey { /* private fields */ }Expand description
The public half of a device’s key-agreement key.
A device holds the authenticated public keys of the peers it will talk to and uses them to agree a session key. It is 32 bytes on the wire.
Implementations§
Source§impl AgreementPublicKey
impl AgreementPublicKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Self
pub fn from_bytes(bytes: &[u8; 32]) -> Self
Reconstructs a public key from its 32-byte form.
§Arguments
bytes- the 32-byte encoded public key.
§Returns
The public key. Every 32-byte value is a syntactically valid X25519 public key, so this cannot fail; authenticating that the key belongs to the expected device is the caller’s responsibility.
Trait Implementations§
Source§impl Clone for AgreementPublicKey
impl Clone for AgreementPublicKey
Source§fn clone(&self) -> AgreementPublicKey
fn clone(&self) -> AgreementPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AgreementPublicKey
Source§impl Debug for AgreementPublicKey
impl Debug for AgreementPublicKey
impl Eq for AgreementPublicKey
Source§impl PartialEq for AgreementPublicKey
impl PartialEq for AgreementPublicKey
Source§fn eq(&self, other: &AgreementPublicKey) -> bool
fn eq(&self, other: &AgreementPublicKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AgreementPublicKey
Auto Trait Implementations§
impl Freeze for AgreementPublicKey
impl RefUnwindSafe for AgreementPublicKey
impl Send for AgreementPublicKey
impl Sync for AgreementPublicKey
impl Unpin for AgreementPublicKey
impl UnsafeUnpin for AgreementPublicKey
impl UnwindSafe for AgreementPublicKey
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