Struct olm_rs::pk::OlmPkEncryption[][src]

pub struct OlmPkEncryption { /* fields omitted */ }

The encryption part of a PK encrypted channel.

Implementations

impl OlmPkEncryption[src]

pub fn new(recipient_key: String) -> Self[src]

Create a new PK encryption object.

Arguments

  • recipient_key - a public key that will be used for encryption, the public key will be provided by the matching decryption object.

pub fn encrypt(&self, plaintext: &str) -> PkMessage[src]

Encrypt a plaintext message.

Returns the encrypted PkMessage.

Arguments

  • plaintext - A string that will be encrypted using the PkEncryption object.

Panics

  • InputBufferTooSmall if the ciphertext, ephemeral key, or mac buffers are too small.
  • OutputBufferTooSmall if the random buffer is too small.
  • on malformed UTF-8 coding of the ciphertext provided by libolm

Trait Implementations

impl Drop for OlmPkEncryption[src]

impl Send for OlmPkEncryption[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, 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.