RustCrypto/RSA

Encrypting and signing

PaulDotSH opened this issue · 1 comments

Hi, when using something like Kleopatra, when you encrypt a piece of text, you can encrypt it for multiple people and sign it, is there any way of signing the encrypted data?

        let rsa_key = RsaPublicKey::from_public_key_pem(pub_key)?;
        let padding = Oaep::new::<sha2::Sha256>();
        let encrypted_data = rsa_key.encrypt(OsRng.borrow_mut(), padding, data)?;

This is the current code I have, the thing is that it does not require any kind of private key, and I would like to provide it with a private key to sign the encrypted data, so the user knows the data source is actually legitimate

I think you're looking for #231