Openssl 获取RSA私钥而不是私钥
我在client.KEY文件中有一个生成Openssl 获取RSA私钥而不是私钥,openssl,Openssl,我在client.KEY文件中有一个生成私钥的命令。但是我需要RSA私钥。如何做到这一点 openssl req -new -newkey rsa:2048 -keyout client.key -out client.csr -config openssl.cnf -reqexts v3_client_req -nodes -subj "/C=US/ST=California/L=Hawthorne/O=PhilNet/CN=Client/" 重复但在我回答后注意到: doopenssl r
私钥的命令。但是我需要RSA私钥。如何做到这一点
openssl req -new -newkey rsa:2048 -keyout client.key -out client.csr -config openssl.cnf -reqexts v3_client_req -nodes -subj "/C=US/ST=California/L=Hawthorne/O=PhilNet/CN=Client/"
重复但在我回答后注意到:
doopenssl rsa-in-client.key-out-client.old.key
。如果您希望对旧格式文件进行加密,请参阅手册页或帮助消息以获取选项列表(如-aes128
或-des3
),尽管由于您在给出新格式(PKCS8)文件的命令中请求取消加密,我猜这就是您对旧格式文件的要求。另外,旧格式加密使用的PBKDF比新格式(PKCS8)弱得多;关于这一点,在多个堆栈上有许多现有的Qs
或者,不要在req-new
命令中生成密钥,而是单独生成:
openssl genrsa -out client.key 2048 # old command uses old-format keyfile
# can add option to encrypt old-format file, similar to above
openssl req -new -key client.key -out client.csr -config ....
(不推荐)使用旧的OpenSSL版本:0.9.x,2010年之前最新版本,直到2015年仍受支持,将req-new[key]
的输出默认为旧格式(尽管OpenSSL大约从2000年开始支持PCKS8)