pub struct BoxKeyPair { /* private fields */ }Expand description
An X25519 keypair, for key agreement and sealed boxes.
Implementations§
Source§impl BoxKeyPair
impl BoxKeyPair
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
A keypair from 32 bytes of secret.
Sourcepub fn from_base64(encoded: &str) -> Result<Self>
pub fn from_base64(encoded: &str) -> Result<Self>
A keypair from base64.
Sourcepub fn to_base64(&self) -> String
pub fn to_base64(&self) -> String
The secret, as base64:…. Keep this out of anything published.
Sourcepub fn public(&self) -> BoxPublicKey
pub fn public(&self) -> BoxPublicKey
The public half.
Sourcepub fn agree(&self, theirs: &BoxPublicKey) -> Key
pub fn agree(&self, theirs: &BoxPublicKey) -> Key
Trait Implementations§
Source§impl Clone for BoxKeyPair
impl Clone for BoxKeyPair
Source§fn clone(&self) -> BoxKeyPair
fn clone(&self) -> BoxKeyPair
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 moreAuto Trait Implementations§
impl Freeze for BoxKeyPair
impl RefUnwindSafe for BoxKeyPair
impl Send for BoxKeyPair
impl Sync for BoxKeyPair
impl Unpin for BoxKeyPair
impl UnsafeUnpin for BoxKeyPair
impl UnwindSafe for BoxKeyPair
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