[][src]Struct xaynet::crypto::SecretEncryptKey

pub struct SecretEncryptKey(_);

A C25519 secret key for asymmetric authenticated encryption.

When this goes out of scope, its contents will be zeroed out.

Implementations

impl SecretEncryptKey[src]

pub fn decrypt(&self, c: &[u8], pk: &PublicEncryptKey) -> Result<Vec<u8>, ()>[src]

Decrypts the ciphertext c using this secret key and the associated public key, and returns the decrypted message.

Errors

Returns Err(()) if decryption fails.

pub fn public_key(&self) -> PublicEncryptKey[src]

Computes the corresponding public key for this secret key.

Trait Implementations

impl AsMut<SecretKey> for SecretEncryptKey[src]

impl AsRef<SecretKey> for SecretEncryptKey[src]

impl ByteObject for SecretEncryptKey[src]

impl Clone for SecretEncryptKey[src]

impl Debug for SecretEncryptKey[src]

impl<'de> Deserialize<'de> for SecretEncryptKey[src]

impl Eq for SecretEncryptKey[src]

impl From<SecretKey> for SecretEncryptKey[src]

impl PartialEq<SecretEncryptKey> for SecretEncryptKey[src]

impl Serialize for SecretEncryptKey[src]

impl StructuralEq for SecretEncryptKey[src]

impl StructuralPartialEq for SecretEncryptKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]