[][src]Function yaca::rsa_public_encrypt

pub fn rsa_public_encrypt(
    padding: &Padding,
    pub_key: &Key,
    plaintext: &[u8]
) -> Result<Vec<u8>>

Encrypts data using a RSA public key (low-level encrypt equivalent)

  • padding defines the padding method used in encryption.
  • The pub_key has to be of a KeyType::RsaPublic type.
  • The plaintext is the data to be encrypted, it can be empty.
  • The maximum length of plaintext depends on the key length and padding method. See Padding for details.