在Ubuntu中,我可以通过命令将Pub键从OpenSSH格式转换为PKCS8格式:
ssh-keygen -e -f .ssh/id_rsa.bar -m PKCS8
但是在CentOS 6.4中,当我执行相同的命令时,它会注意到:
ssh-keygen:非法选项-- m
我在CentOS6.4上阅读了ssh-keygen的手册页,发现它没有选项"-m“。那么,如何在Centos 6.4上完成相同的任务呢?
非常感谢!
发布于 2013-09-09 10:47:32
在RHEL系统和衍生产品中,您可以使用openssl完成此任务:
# openssl pkcs8 --help
Usage pkcs8 [options]
where options are
-in file input file
-inform X input format (DER or PEM)
-passin arg input file pass phrase source
-outform X output format (DER or PEM)
-out file output file
-passout arg output file pass phrase source
-topk8 output PKCS8 file
-nooct use (nonstandard) no octet format
-embed use (nonstandard) embedded DSA parameters format
-nsdb use (nonstandard) DSA Netscape DB format
-noiter use 1 as iteration count
-nocrypt use or expect unencrypted private key
-v2 alg use PKCS#5 v2.0 and cipher "alg"
-v1 obj use PKCS#5 v1.5 and cipher "alg"
-engine e use engine e, possibly a hardware device.此外,pkcs8(1)手册提供了几个示例。
openssl pkcs8 -topk8 -in private.key.pem -out private.key.pk8.pem -v2 des3https://serverfault.com/questions/537432
复制相似问题