Skip to main content

RandomizedEncryptor

Trait RandomizedEncryptor 

Source
pub trait RandomizedEncryptor {
    // Required methods
    fn encrypt_with_rng_into<'a, R: TryCryptoRng + ?Sized>(
        &self,
        rng: &mut R,
        msg: &[u8],
        storage: &'a mut [u8],
    ) -> Result<&'a [u8]>;
    fn encrypt_with_rng<R: CryptoRng + ?Sized>(
        &self,
        rng: &mut R,
        msg: &[u8],
    ) -> Result<Vec<u8>>;
}
Expand description

Encrypt the message using provided random source

Required Methods§

Source

fn encrypt_with_rng_into<'a, R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], storage: &'a mut [u8], ) -> Result<&'a [u8]>

Encrypt the given message into caller-provided storage.

Source

fn encrypt_with_rng<R: CryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], ) -> Result<Vec<u8>>

Available on crate feature alloc only.

Encrypt the given message.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D, MGD, T, M> RandomizedEncryptor for rsa::oaep::GenericEncryptingKey<D, MGD, T, M>
where D: Digest, MGD: Digest + FixedOutputReset, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

impl<T, M> RandomizedEncryptor for rsa::pkcs1v15::GenericEncryptingKey<T, M>
where T: UnsignedModularInt, M: ModulusParams<Modulus = T>,