[][src]Struct koibumi_core::crypto::Encrypted

pub struct Encrypted { /* fields omitted */ }

A encrypted message.

Implementations

impl Encrypted[src]

pub fn encrypt(
    data: impl AsRef<[u8]>,
    public_key: &PublicKey
) -> Result<Self, EncryptError>
[src]

Encrypts data and returns a encrypted object.

pub fn decrypt(&self, private_key: &PrivateKey) -> Result<Vec<u8>, DecryptError>[src]

Decrypts this encrypted object and returns the decrypted bytes.

Trait Implementations

impl Clone for Encrypted[src]

impl Debug for Encrypted[src]

impl Eq for Encrypted[src]

impl Hash for Encrypted[src]

impl PartialEq<Encrypted> for Encrypted[src]

impl SizedReadFrom for Encrypted[src]

impl StructuralEq for Encrypted[src]

impl StructuralPartialEq for Encrypted[src]

impl WriteTo for Encrypted[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> From<T> 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> SizedReadFromExact for T where
    T: SizedReadFrom
[src]

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.