pub struct OlmPkEncryption { /* private fields */ }
Expand description
The encryption part of a PK encrypted channel.
Implementations§
Source§impl OlmPkEncryption
impl OlmPkEncryption
Sourcepub fn new(recipient_key: &str) -> Self
pub fn new(recipient_key: &str) -> Self
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.
Sourcepub fn encrypt(&self, plaintext: &str) -> PkMessage
pub fn encrypt(&self, plaintext: &str) -> PkMessage
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§
Source§impl Drop for OlmPkEncryption
impl Drop for OlmPkEncryption
impl Send for OlmPkEncryption
Auto Trait Implementations§
impl Freeze for OlmPkEncryption
impl RefUnwindSafe for OlmPkEncryption
impl !Sync for OlmPkEncryption
impl Unpin for OlmPkEncryption
impl UnwindSafe for OlmPkEncryption
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