Generates an RSA keypair, returning the public and private keys in variables, and encrypting the private key with passphrase.
rsa_generate_keypair_mem( pubkey var, privkey var, bits, e, passphrase )
Returns 1 on success, 0 on error.
pubkey = The variable which receives the generated public key
privkey = The variable which receives the generated private key
bits = The RSA modulus size, in bits
e = The public key exponent. Must be an odd number, typically 3, 17 or 65537
passphrase = The passphrase used to encrypt the private key
This function generates an RSA keypair, storing the public and private components in files in the variables specified.
The public key is encoded using a PKCS#1 RSAPublicKey structure.
The private key is encrypted using triple-DES in EDE mode with cipher block chaining (DES-EDE3-CBC) using the provided passphrase and stored in in PKCS#8 EncryptedPrivateKeyInfo format using PKCS#5 v2.0 password based encryption algorithms.