我有以下命令供 OpenSSL 生成私钥和公钥:
openssl genrsa –aes-128-cbc –out priv.pem –passout pass:[privateKeyPass] 2048
和
openssl req –x509 –new –key priv.pem –passin pass:[privateKeyPass] -days 3650 –out cert.cer
...但他们没有工作。对于第一个命令,我收到以下错误:
usage: genrsa [args] [numbits]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-seed
encrypt PEM output with cbc seed
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the key to 'file
-passout arg output file pass phrase source
-f4 use F4 (0x10001) for the E value
-3 use 3 for the E value
-engine e use engine e, possibly a hardware device.
-rand file:file:...
load the file (or the files in the directory) into
the random number generator
我究竟做错了什么?
编辑:我解决了第一个命令:
openssl genrsa -aes128 -out privkey.pem 2048
但是现在我遇到了第二个错误:
unknown option –x509