Struct eznacl::EncryptionPair
source · [−]pub struct EncryptionPair { /* private fields */ }
Expand description
An asymmetric encryption keypair
Implementations
sourceimpl EncryptionPair
impl EncryptionPair
sourcepub fn from(
pubkey: &CryptoString,
privkey: &CryptoString
) -> Result<EncryptionPair, EzNaclError>
pub fn from(
pubkey: &CryptoString,
privkey: &CryptoString
) -> Result<EncryptionPair, EzNaclError>
Creates a new EncryptionPair from two CryptoString objects
sourcepub fn from_strings(
pubstr: &str,
privstr: &str
) -> Result<EncryptionPair, EzNaclError>
pub fn from_strings(
pubstr: &str,
privstr: &str
) -> Result<EncryptionPair, EzNaclError>
Creates a new EncryptionPair from two strings containing CryptoString-formatted data
sourcepub fn generate(algorithm: &str) -> Result<EncryptionPair, EzNaclError>
pub fn generate(algorithm: &str) -> Result<EncryptionPair, EzNaclError>
Generates a Curve25519 asymmetric encryption keypair.
Trait Implementations
sourceimpl Clone for EncryptionPair
impl Clone for EncryptionPair
sourcefn clone(&self) -> EncryptionPair
fn clone(&self) -> EncryptionPair
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl CryptoInfo for EncryptionPair
impl CryptoInfo for EncryptionPair
sourceimpl Debug for EncryptionPair
impl Debug for EncryptionPair
sourceimpl Decryptor for EncryptionPair
impl Decryptor for EncryptionPair
sourcefn decrypt(&self, encdata: &CryptoString) -> Result<Vec<u8>, EzNaclError>
fn decrypt(&self, encdata: &CryptoString) -> Result<Vec<u8>, EzNaclError>
Decrypts the provided Curve25519-encrypted data. Note that this is slower than symmetric encryption and should be used only on small data sets.
sourceimpl Encryptor for EncryptionPair
impl Encryptor for EncryptionPair
sourcefn encrypt(&self, data: &[u8]) -> Result<CryptoString, EzNaclError>
fn encrypt(&self, data: &[u8]) -> Result<CryptoString, EzNaclError>
Encrypts the provided data using the Curve25519 algorithm. Note that this is slower than symmetric encryption and should be used only on small data sets.
sourceimpl PartialEq<EncryptionPair> for EncryptionPair
impl PartialEq<EncryptionPair> for EncryptionPair
sourcefn eq(&self, other: &EncryptionPair) -> bool
fn eq(&self, other: &EncryptionPair) -> bool
sourceimpl PartialOrd<EncryptionPair> for EncryptionPair
impl PartialOrd<EncryptionPair> for EncryptionPair
sourcefn partial_cmp(&self, other: &EncryptionPair) -> Option<Ordering>
fn partial_cmp(&self, other: &EncryptionPair) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl PrivateKey for EncryptionPair
impl PrivateKey for EncryptionPair
sourcefn get_private_key(&self) -> CryptoString
fn get_private_key(&self) -> CryptoString
Returns the private key as a CryptoString object
sourcefn get_private_str(&self) -> String
fn get_private_str(&self) -> String
Returns the private key as a string
sourceimpl PublicKey for EncryptionPair
impl PublicKey for EncryptionPair
sourcefn get_public_key(&self) -> CryptoString
fn get_public_key(&self) -> CryptoString
Returns the public key as a CryptoString object
sourcefn get_public_str(&self) -> String
fn get_public_str(&self) -> String
Returns the public key as a string
impl StructuralPartialEq for EncryptionPair
Auto Trait Implementations
impl RefUnwindSafe for EncryptionPair
impl Send for EncryptionPair
impl Sync for EncryptionPair
impl Unpin for EncryptionPair
impl UnwindSafe for EncryptionPair
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more