Windows下Openssl安裝以及編程

來源:互聯網
上載者:User

1、安裝VC++ 6.0。    
2、下載ActivePerl-5.8.0.806-MSWin32-x86並安裝:

http://www.sogoz.info/down.asp?id=3683&no=1

3、下載 openssl0.98並解壓。

http://www.openssl.org/source/openssl-0.9.8.tar.gz

    
安裝步驟:完全可以參照openssl目錄下的install.win32
1、perl Configure VC-WIN32
如不成功會有明顯提示
2、ms\do_ms
推薦使用這種方式
    另外兩種方式 如果使用也必須保證本機有編譯器才能使用。
     :ms\do_masm (預設vc 內建的編譯器;也也以自己下載安裝)    
     :ms\do_nasm (需要自己下載)
    
    
3、DOS視窗下轉到【Microsoft Visual Studio】\VC98\bin目錄下執行 vcvars32.bat 以配置環境變數。
4、跳到openssl目錄下,執行:
nmake -f ms\ntdll.mak

如果編譯成功,最後的輸出都在out32dll目錄下:包括可執行檔、兩個dll和兩個lib檔案: libeay32.dll, libeay32.lib, ssleay32.dll, ssleay32.lib

編程初步:

1、 開啟VC-Tools-Options-Directores,在Include files中增加【openssl-0.9.8】\inc32目錄;在Libray files中增加【openssl-0.9.8】\out32dll
2、 在來源程式中包含以下三個標頭檔並加入LIB:
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")

3、 參考源碼開始編程:http://www.kennethballard.com/Download/intro-openssl.zip

參考:

使用 OpenSSL API 進行安全編程

http://www-128.ibm.com/developerworks/cn/linux/l-openssl.html

OpenSSL官方網站:http://www.openssl.org/  

文章出處:http://www.diybl.com/course/4_webprogram/asp.net/netjs/2008223/100573.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.