[Original] opensc project compilation on Windows Platform

Source: Internet
Author: User
Tags openssl lib piv card

I searched for the introduction of opensc on Google. No, I 'd better say it myself.

Opensc official website http://www.opensc-project.org/

Project Description: opensc provides a set of libraries and tools for accessing smart cards. Opensc focuses on card password operations to promote card applications such as email encryption, authentication, and signature. Opensc implements the PKCS #11 API so that it can be used by Mozilla Firefox and Thunderbird. Opensc implements the PKCS #15 standard to be compatible with all applications.

Opensc supports the following cards:

 

National ID cards
  • Finnish ID card fineid
  • Swedish Posten Eid
  • Estonian ID card esteid
  • Italian infocamere
  • Italian postecert
  • Italian CNS/CIE (EID)
  • Belgian Eid
  • Spanish Ceres
  • German ID cards, ehba, egk
  • Taiwan
  • Austrian bürgerkarte, e-card
  • Australian national ID card
  • United States PIV card Applet
  • Turkish Eid card
Smart Cards
  • Schlumberger/Axalto cryptoflex
  • Schlumberger/Axalto cyberflex
  • Gemplus GPK
  • EMV
  • Siemens cardos M4
  • IBM jcop
  • Micardo
  • Oberthur
  • Openpgp
  • Setec setcos
  • Giesecke & Devrient starcos
  • Giesecke & Devrient seccos
  • TCOs based cards (netkey E4, signtrust, smartkey)
  • Akis smart cards
USB tokens
  • Aladdin etoken pro
  • Eutron cryptoidentity ITSEC
  • Schlumberger/Axalto e-gate
  • Rainbow Ikey 3000
  • Rainbow Ikey 4000 not supported
  • Feitian epass3000 (epass3000 of Apsara integrity in China)

Ii. compiling environment

Operating System: Windows XP SP3

Development Tool: vistual Studio 2003 SP1

Code: opensc-0.11.6.tar.gz

Library: OpenSSL 0.9.7e.tar.gzw.libtool-1.5.26-bin.zip

 

Iii. compilation process

Libtool: Decompress the zip package to c: \ (or another directory ).

OpenSSL: Decompress the tar.gz package to c: \, compile it, and perform the following steps: (there are many OpenSSL compiling examples in Windows on Google)

Opensc: Decompress the tar.gz package to c: \ and edit it.Win32/make. Rules. Mak. The edited file is pasted below:

 

# Note: These Instructions obsolete the instructions in opensc.html

# You first need to download the gnuwin32 libtool (e.g. The "binaries" and "Developer
# Files "from http://gnuwin32.sourceforge.net/packages/libtool.htm)
# Then fill in the directory path to ltdl. H on the libltdl_incl line below, preceeded
# By an "/I"; and fill in the path to the libltdl. lib on the libltdl_lib line below.
# Then you can build this opensc package; and afterwards you'll need to copy
# Libltdl3.dll somewhere on your execution path.
Libltdl_incl =/IC: \ libtool-1.5.26-bin \ include # e. g./IC: \ libtool-1.5.8-lib \ include (here change to your own path, my drive C)
Libltdl_lib = c: \ libtool-1.5.26-bin \ Lib \ ltdl. Lib # e. g. c: \ libtool-1.5.8-lib \ Lib \ libltdl. Lib (here change to your own path, my disk is C)

Opensc_features = pcsc

# If you want support for OpenSSL (needed for a. o. pkcs15-init tool and OpenSSL engine ):
#-Download and build OpenSSL
#-Uncomment the line starting with openssl_def
#-Set the openssl_incl_dir below to your OpenSSL include directory, preceded by "/I"
#-Set the openssl_lib below to your OpenSSL lib File
Openssl_def =/denable_openssl # Open this option. OpenSSL is used in the source code. Otherwise, an error is reported.
! If "$ (openssl_def)" = "/denable_openssl"
Openssl_incl_dir =/ie: \ Software \ keystore \ OpenSSL \ openssl-0.9.7c \ include # change the path here
Openssl_lib = E: \ Software \ keystore \ OpenSSL \ openssl-0.9.7c \ out32dll \ debug \ libeay32.lib # point to the compiled libeay32.lib
Programs_openssl = pkcs15-init.exe cryptoflex-tool.exe netkey-tool.exe piv-tool.exe
Opensc_features = $ (opensc_features) OpenSSL
! Endif

# If you want support for zlib (used for PIV, infocamere and actalis:
#-Download zlib and build
#-Uncomment the line starting with zlib_def
#-Set the zlib_incl_dir below to the zlib include lib proceeded by "/I"
#-Set the zlib_lib below to your zlib lib File
# Zlib_def =/denable_zlib
! If "$ (zlib_def)" = "/denable_zlib"
Zlib_incl_dir =/IC: \ zlib \ include
Zlib_lib = c: \ zlib \ Lib \ zlib. Lib
Opensc_features = $ (opensc_features) zlib
! Endif

Copts =/d_crt_secure_no_deprecate/Zi/MD/nologo/dhave_config_h/I $ (topdir) \ SRC \ include \ opensc/I $ (topdir) \ SRC \ common $ (openssl_incl_dir) $ (zlib_incl_dir) $ (libltdl_incl)/d_win32_winnt = 0x0400/dwin32_lean_and_mean $ (openssl_def) $ (zlib_def) /dopensc_features = "\" $ (opensc_features )\""
Linkflags =/debug/nologo/Incremental: No/machine: ix86

Install-headers:
@ For % I in ($ (headers) do \
@ Xcopy/D/Q/Y % I $ (headersdir)> NUL

Install-headers-Dir:
@ For % I in ($ (headersdirfrom2) do \
@ Xcopy/D/Q/Y % I \ *. h $ (headersdir2) \ *. h> NUL

. C. OBJ ::
CL $ (Copts)/C $ <

. Rc. Res ::
RC/L 0x0409/r $ <

Clean ::
Del/Q *. OBJ *. dll *. EXE *. PDB *. lib *. Def

 

Open the vistudio Studio. NET 2003 Command Prompt window and run nmake-F makefile. Mak in the opensc root directory. The compilation is successful!

Finally, we recommend a professional information security forum http://www.infosec-china.cn

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.