📄 genkeys.sh
字号:
#!/bin/sh# generate the key for Aopenssl genrsa -out keyA-priv.pem 512# generate the key for Bopenssl genrsa -out keyB-priv.pem 512# now turn A into self-signed certificateecho "Generating certificate request."echo "Please set CN=fakea.openswan.org and E=fakea@openswan.org"openssl req -config ./openssl.cnf -new -key keyA-priv.pem -out keyA.reqopenssl x509 -days 3650 -req -signkey keyA-priv.pem -in keyA.req -out keyA.crt# now turn B into self-signed certificateecho "Generating certificate request."echo "Please set CN=fakeb.openswan.org and E=fakeb@openswan.org"openssl req -config ./openssl.cnf -new -key keyB-priv.pem -out keyB.reqopenssl x509 -days 3650 -req -signkey keyB-priv.pem -in keyB.req -out keyB.crt# now sign B's req with A's key.openssl x509 -days 3650 -CA keyA.crt -CAkey keyA-priv.pem -CAserial fakeindex.txt -req -in keyB.req -out keyAB.crt# cert certificates to DER format, and concatenate them.# we keep a uuencoded copy of the concatenation.openssl asn1parse -inform pem -in keyAB.crt -noout -out keyAB.der openssl asn1parse -inform pem -in keyB.crt -noout -out keyB.der cat keyAB.der keyB.der | uuencode keyChain.der >keyChain.duu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -