【发布时间】:2012-09-28 09:22:36
【问题描述】:
我有以下命令让 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
【问题讨论】:
-
不知道参数的顺序是否重要?
-
命令中的一些破折号实际上是破折号 (-) 而不是连字符 (-)。
标签: openssl rsa private-key public-key