See also Cipher.encrypt(String, CertificateRef, String, String, Number) on how to generate RSA key pairs.