我是靠谱客的博主 忧郁期待,这篇文章主要介绍Openssl ec命令,现在分享给大家,希望可以做个参考。

一、简介

椭圆曲线密钥处理工具

 

二、语法

复制代码
1
openssl ec [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-out filename] [-passin arg] [-passout arg] [-text] [-noout] [-param_out] [-conv_form arg] [-pubin] [-pubout] [-param_enc arg] [-engine id] [-des] [-des3] [-idea]

选项

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-inform arg input format - DER or PEM -outform arg output format - DER or PEM -in arg input file -passin arg input file pass phrase source -out arg output file -passout arg output file pass phrase source -engine e use engine e, possibly a hardware device. -des encrypt PEM output, instead of 'des' every other cipher supported by OpenSSL can be used -text print the key -noout don't print key out -param_out print the elliptic curve parameters -conv_form arg specifies the point conversion form possible values: compressed uncompressed (default) hybrid -param_enc arg specifies the way the ec parameters are encoded in the asn1 der encoding possible values: named_curve (default) explicit

 

三、实例

1、生成EC私钥

复制代码
1
openssl ecparam -genkey -name prime256v1 -param_enc explicit -outform pem -out ec_prikey.pem

2、对私钥进行口令保护

复制代码
1
openssl ec -in ec_prikey.pem -des -out ec_prikey.pem
复制代码
1
openssl ec -in ec_prikey.pem -des -passout pass:"123456" -out ec_prikey.pem

image

3、从私钥提取公钥

复制代码
1
openssl ec -in ec_prikey.pem -pubout -out ec_pubkey.pem

image

4、查看私钥信息

复制代码
1
openssl ec -in ec_prikey.pem -passin pass:"123456" -text

5、查看公钥信息

复制代码
1
openssl ec -in ec_pubkey.pem -pubin -text

6、pem为der

复制代码
1
openssl ec -in ec_prikey.pem -outform der -out ec_prikey.der

image

 

复制代码
1
参考:http://blog.csdn.net/as3luyuan123/article/details/14138983

最后

以上就是忧郁期待最近收集整理的关于Openssl ec命令的全部内容,更多相关Openssl内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(87)

评论列表共有 0 条评论

立即
投稿
返回
顶部