现在的位置: 首页 > 综合 > 正文

SSL协议的下载及编译使用

2018年02月14日 ⁄ 综合 ⁄ 共 1151字 ⁄ 字号 评论关闭

一:SSL协议的下载:

下载地址:http://www.openssl.org/source/

二:SSL协议编译

下载下来的文件是一个压缩包,解压出来,你是找不到一个文件来打开进行界面操作的。

需使用命令编译。

编译步骤 原文链接:http://blog.csdn.net/everandforever/article/details/6102781

VC2010步骤:

 

1. 安装 ActivePerl

     activePerl下载地址:http://www.activestate.com/activeperl

2. 从Windows开始菜单运行“Visual Studio Command Prompt (2010)”

 

3. 进入openssl目录,例如 D:\openssl-1.0.0c,执行以下命令:

D:\openssl-1.0.0c>perl Configure VC-WIN32 --prefix=D:\openssl-1.0.0c

 

D:\openssl-1.0.0c>ms\do_ms

 

D:\openssl-1.0.0c>nmake -f ms\nt.mak

 

4. 以上是将openssl编译为静态链接的lib文件。如需编译为dll,最后一个命令改成

D:\openssl-1.0.0c>nmake -f ms\ntdll.mak

三、使用openssl.exe将证书或秘钥转换成pem文件

原文链接:http://hi.baidu.com/yang_qi168/item/480304c542fd246489ad9e91

使用OpenSSL

1、将aps_developer_identity.cer转换成 aps_developer_identity.pem格式。

openssl > x509 -in aps_developer_identity.cer -inform DER -out aps_developer_identity.pem -outform PEM

2、将p12格式的私钥转换成pem

openssl> pkcs12 -nocerts -out key.pem -in key.p12

3、用certificate和the key 创建PKCS#12格式的文件。

openssl >pkcs12 -export -in aps_developer_identity.pem -inkey PushChat_Noenc.pem -certfile PushChat.certSigningRequest -name "aps_developer_identity" -out aps_developer_identity.p12

这样我们就得到了在.net应用程序中使用的证书文件:aps_developer_identity.p12。

抱歉!评论已关闭.