证书要钱还贵,但金融系统报文必需要进行安全传输,怎么办,本身生成证书吧,这篇博客记录的背景是: 生成一对 RSA 钥匙,公钥采用 X。509 进行加密,私钥采用 PKCS8 进行加密, 字节长度为1024数据库
OpenSSL安装包安全
Windows7 64Bit加密
1,下载并安装OpenSSL,设置环境变量code
OPENSSL_HOME = D:\MySoftware\OpenSSL-Win64 Path = Path + ; + % + OPENSSL_HOME + % + \bin + ;
2,建立一个你将用来建立证书的目录,例如个人是 F:\Testorm
3,文件和目录补齐(若是不补齐在自签证书时会报找不到文件的错)server
index.txt OpenSSL在建立自签证书时会向该文件里写下索引 database.txt OpenSSL会模拟数据库将一些敏感信息写在该文件里 erial.txt 建立该文件后,请编辑在第一行写下 01 certs 文件夹,目前没什么用,仅仅只是我配置文件这样写 注意: 这里提到的全部文件必须补齐,而且文件名不得更改 !
4,生成证书排序
openssl genrsa -des3 -out root.key 1024 openssl req -new -key root.key -out root.csr openssl req -new -x509 -key root.csr -out root.crt -days 365 -config ../openssl.conf openssl req -new -x509 -key root.key -out root.crt -days 365 -config ../openssl.conf openssl genrsa -out server.key 1024 openssl req -new -key server.key -out server.csr -config openssl.conf openssl ca -in server.csr -out server.crt -keyfile root.key -cert root.crt -days 365 -config openssl.conf
5,经常使用格式转换索引
openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt openssl x509 -inform pem -in server.crt -outform der -out server_public.cer