pub trait PaddingScheme {
// Required methods
fn decrypt<Rng: TryCryptoRng + ?Sized>(
self,
rng: Option<&mut Rng>,
priv_key: &RsaPrivateKey,
ciphertext: &[u8],
) -> Result<Vec<u8>>;
fn encrypt<Rng, K, T>(
self,
rng: &mut Rng,
pub_key: &K,
msg: &[u8],
) -> Result<Vec<u8>>
where Rng: TryCryptoRng + ?Sized,
T: UnsignedModularInt,
K: PublicKeyParts<T>;
}Expand description
Padding scheme used for encryption.
Required Methods§
Sourcefn decrypt<Rng: TryCryptoRng + ?Sized>(
self,
rng: Option<&mut Rng>,
priv_key: &RsaPrivateKey,
ciphertext: &[u8],
) -> Result<Vec<u8>>
Available on crate feature private-key only.
fn decrypt<Rng: TryCryptoRng + ?Sized>( self, rng: Option<&mut Rng>, priv_key: &RsaPrivateKey, ciphertext: &[u8], ) -> Result<Vec<u8>>
private-key only.Decrypt the given message using the given private key.
If an rng is passed, it uses RSA blinding to help mitigate timing
side-channel attacks.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl PaddingScheme for Pkcs1v15Encrypt
impl<D, MGD> PaddingScheme for Oaep<D, MGD>
Available on crate feature
alloc only.