Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
ccd395cb
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ccd395cb
编写于
1月 25, 2012
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add example for DH certificate generation
上级
0d609395
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
1 deletion
+44
-1
demos/certs/ca.cnf
demos/certs/ca.cnf
+12
-0
demos/certs/mkcerts.sh
demos/certs/mkcerts.sh
+32
-1
未找到文件。
demos/certs/ca.cnf
浏览文件 @
ccd395cb
...
@@ -42,6 +42,18 @@ nsComment = "OpenSSL Generated Certificate"
...
@@ -42,6 +42,18 @@ nsComment = "OpenSSL Generated Certificate"
subjectKeyIdentifier=hash
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
authorityKeyIdentifier=keyid
[ dh_cert ]
# These extensions are added when 'ca' signs a request for an end entity
# DH certificate
basicConstraints=critical, CA:FALSE
keyUsage=critical, keyAgreement
# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
[ v3_ca ]
[ v3_ca ]
...
...
demos/certs/mkcerts.sh
浏览文件 @
ccd395cb
#!/bin/sh
#!/bin/sh
OPENSSL
=
openssl
OPENSSL
=
../../apps/openssl
OPENSSL_CONF
=
../../apps/openssl.cnf
export
OPENSSL_CONF
# Root CA: create certificate directly
# Root CA: create certificate directly
CN
=
"Test Root CA"
$OPENSSL
req
-config
ca.cnf
-x509
-nodes
\
CN
=
"Test Root CA"
$OPENSSL
req
-config
ca.cnf
-x509
-nodes
\
...
@@ -23,3 +25,32 @@ CN="Test Client Cert" $OPENSSL req -config ca.cnf -nodes \
...
@@ -23,3 +25,32 @@ CN="Test Client Cert" $OPENSSL req -config ca.cnf -nodes \
# Sign using intermediate CA
# Sign using intermediate CA
$OPENSSL
x509
-req
-in
creq.pem
-CA
intca.pem
-CAkey
intkey.pem
-days
3600
\
$OPENSSL
x509
-req
-in
creq.pem
-CA
intca.pem
-CAkey
intkey.pem
-days
3600
\
-extfile
ca.cnf
-extensions
usr_cert
-CAcreateserial
-out
client.pem
-extfile
ca.cnf
-extensions
usr_cert
-CAcreateserial
-out
client.pem
# Example creating a PKCS#3 DH certificate.
# First DH parameters
[
-f
dhp.pem
]
||
$OPENSSL
genpkey
-genparam
-algorithm
DH
-pkeyopt
dh_paramgen_prime_len:1024
-out
dhp.pem
# Now a DH private key
$OPENSSL
genpkey
-paramfile
dhp.pem
-out
dhskey.pem
# Create DH public key file
$OPENSSL
pkey
-in
dhskey.pem
-pubout
-out
dhspub.pem
# Certificate request, key just reuses old one as it is ignored when the
# request is signed.
CN
=
"Test Server DH Cert"
$OPENSSL
req
-config
ca.cnf
-new
\
-key
skey.pem
-out
dhsreq.pem
# Sign request: end entity DH extensions
$OPENSSL
x509
-req
-in
dhsreq.pem
-CA
root.pem
-days
3600
\
-force_pubkey
dhspub.pem
\
-extfile
ca.cnf
-extensions
dh_cert
-CAcreateserial
-out
dhserver.pem
# DH client certificate
$OPENSSL
genpkey
-paramfile
dhp.pem
-out
dhckey.pem
$OPENSSL
pkey
-in
dhckey.pem
-pubout
-out
dhcpub.pem
CN
=
"Test Client DH Cert"
$OPENSSL
req
-config
ca.cnf
-new
\
-key
skey.pem
-out
dhcreq.pem
$OPENSSL
x509
-req
-in
dhcreq.pem
-CA
root.pem
-days
3600
\
-force_pubkey
dhcpub.pem
\
-extfile
ca.cnf
-extensions
dh_cert
-CAcreateserial
-out
dhclient.pem
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录