The keygeneration could also be integrated, similar to the "openssl cmp" app:
relevant options there:
openssl req --help
[...]
-newkey val Specify as type:bits
-pkeyopt val Public key options as opt:value
-keyout outfile File to send the key to
-passout val Output file pass phrase source
-keyout outfile File to send the key to
[...]