首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在PKCS8上将PUB密钥转换为CentOS格式?

在PKCS8上将PUB密钥转换为CentOS格式?
EN

Server Fault用户
提问于 2013-09-09 10:11:12
回答 1查看 5K关注 0票数 2

在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上完成相同的任务呢?

非常感谢!

EN

回答 1

Server Fault用户

发布于 2013-09-09 10:47:32

在RHEL系统和衍生产品中,您可以使用openssl完成此任务:

代码语言:javascript
复制
# 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)手册提供了几个示例。

代码语言:javascript
复制
openssl pkcs8 -topk8 -in private.key.pem -out private.key.pk8.pem -v2 des3

站点中的SEC.SE Q/A提供了对此过程和所涉及的密码学的非常详细的描述。

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/537432

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档