include OpenSC as submodule
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "npa/src/opensc"]
|
||||||
|
path = npa/src/opensc
|
||||||
|
url = git://github.com/OpenSC/OpenSC.git
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
.. highlight:: sh
|
.. highlight:: sh
|
||||||
|
|
||||||
=============
|
============
|
||||||
Installation
|
Installation
|
||||||
=============
|
============
|
||||||
|
|
||||||
The @PACKAGE_NAME@ uses the GNU Build System to compile and install. If you are
|
The @PACKAGE_NAME@ uses the GNU Build System to compile and install. If you are
|
||||||
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
||||||
@@ -10,7 +10,7 @@ around and can not find it, you are probably working bleeding edge in the
|
|||||||
repository. Run the following command in :file:`@PACKAGE_TARNAME@` to
|
repository. Run the following command in :file:`@PACKAGE_TARNAME@` to
|
||||||
get the missing standard auxiliary files::
|
get the missing standard auxiliary files::
|
||||||
|
|
||||||
autoreconf -i
|
autoreconf --verbose --install
|
||||||
|
|
||||||
To configure (:command:`configure --help` lists possible options), build and
|
To configure (:command:`configure --help` lists possible options), build and
|
||||||
install the @PACKAGE_NAME@ now do the following::
|
install the @PACKAGE_NAME@ now do the following::
|
||||||
|
|||||||
@@ -47,19 +47,25 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
|||||||
|
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
PKG_CHECK_EXISTS([libopensc],
|
|
||||||
[PKG_CHECK_MODULES([OPENSC], [libopensc >= 0.12.1 ])],
|
|
||||||
[AC_MSG_WARN([libopensc >= 0.12.1 not found by pkg-config])])
|
|
||||||
test -z "$OPENSC_LIBS" && OPENSC_LIBS="-lopensc"
|
test -z "$OPENSC_LIBS" && OPENSC_LIBS="-lopensc"
|
||||||
|
test -z "$OPENSC_CFLAGS" && OPENSC_CFLAGS="-I${PWD}/${srcdir}/src/opensc/src -DENABLE_SM"
|
||||||
|
|
||||||
|
saved_CPPFLAGS="$CPPFLAGS"
|
||||||
saved_LIBS="$LIBS"
|
saved_LIBS="$LIBS"
|
||||||
|
CPPFLAGS="$OPENSC_CFLAGS $CPPFLAGS"
|
||||||
LIBS="$LDFLAGS $OPENSC_LIBS"
|
LIBS="$LDFLAGS $OPENSC_LIBS"
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([libopensc/opensc.h libopensc/sm.h libopensc/pace.h],
|
||||||
|
[], [AC_MSG_ERROR([OpenSC headers not found])])
|
||||||
AC_MSG_CHECKING([for iasecc_sm_external_authentication])
|
AC_MSG_CHECKING([for iasecc_sm_external_authentication])
|
||||||
AC_TRY_LINK_FUNC(iasecc_sm_external_authentication, [ AC_MSG_RESULT([yes]) ],
|
AC_TRY_LINK_FUNC(iasecc_sm_external_authentication,
|
||||||
[ AC_MSG_ERROR([libopensc configured with SM (git clone git://github.com/frankmorgner/OpenSC.git) not found, use ./configure OPENSC_LIBS=...]) ])
|
[ AC_MSG_RESULT([yes]) ],
|
||||||
|
[ AC_MSG_ERROR([Cannot link against libopensc with SM]) ])
|
||||||
|
|
||||||
|
CPPFLAGS="$saved_CPPFLAGS"
|
||||||
LIBS="$saved_LIBS"
|
LIBS="$saved_LIBS"
|
||||||
|
AC_SUBST([OPENSC_LIBS])
|
||||||
|
AC_SUBST([OPENSC_CFLAGS])
|
||||||
|
|
||||||
|
|
||||||
PKG_CHECK_EXISTS([libcrypto],
|
PKG_CHECK_EXISTS([libcrypto],
|
||||||
@@ -71,16 +77,18 @@ saved_LIBS="$LIBS"
|
|||||||
CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
|
CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
|
||||||
LIBS="$LDFLAGS $OPENSSL_LIBS"
|
LIBS="$LDFLAGS $OPENSSL_LIBS"
|
||||||
|
|
||||||
AC_CHECK_HEADERS(openssl/evp.h, [], [ AC_MSG_ERROR([openssl/evp.h not found, install OpenSSL or use ./configure OPENSSL_CFLAGS=...]) ])
|
AC_CHECK_HEADERS(openssl/evp.h, [],
|
||||||
|
[ AC_MSG_ERROR([OpenSSL headers not found]) ])
|
||||||
AC_MSG_CHECKING([for EVP_read_pw_string_min])
|
AC_MSG_CHECKING([for EVP_read_pw_string_min])
|
||||||
AC_TRY_LINK_FUNC(EVP_read_pw_string_min, [ AC_MSG_RESULT([yes]) ], [ AC_MSG_ERROR([OpenSSL not found, use ./configure OPENSSL_LIBS=...]) ])
|
AC_TRY_LINK_FUNC(EVP_read_pw_string_min,
|
||||||
|
[ AC_MSG_RESULT([yes]) ],
|
||||||
|
[ AC_MSG_ERROR([Cannot link against libcrypto]) ])
|
||||||
|
|
||||||
CPPFLAGS="$saved_CPPFLAGS"
|
CPPFLAGS="$saved_CPPFLAGS"
|
||||||
LIBS="$saved_LIBS"
|
LIBS="$saved_LIBS"
|
||||||
|
|
||||||
|
|
||||||
PKG_CHECK_EXISTS([libeac],
|
PKG_CHECK_EXISTS([libeac], [PKG_CHECK_MODULES([OPENPACE], [libeac])],
|
||||||
[PKG_CHECK_MODULES([OPENPACE], [libeac])],
|
|
||||||
[AC_MSG_WARN([libeac not found by pkg-config])])
|
[AC_MSG_WARN([libeac not found by pkg-config])])
|
||||||
|
|
||||||
saved_CPPFLAGS="$CPPFLAGS"
|
saved_CPPFLAGS="$CPPFLAGS"
|
||||||
@@ -88,9 +96,11 @@ saved_LIBS="$LIBS"
|
|||||||
CPPFLAGS="$CPPFLAGS $OPENPACE_CFLAGS"
|
CPPFLAGS="$CPPFLAGS $OPENPACE_CFLAGS"
|
||||||
LIBS="$LDFLAGS $OPENPACE_LIBS"
|
LIBS="$LDFLAGS $OPENPACE_LIBS"
|
||||||
|
|
||||||
AC_CHECK_HEADERS(eac/eac.h, [], [ AC_MSG_ERROR([eac/eac.h not found, install OpenPACE or use ./configure OPENSSL_CFLAGS=...]) ])
|
AC_CHECK_HEADERS(eac/eac.h, [],
|
||||||
|
[ AC_MSG_ERROR([OpenPACE headers not found]) ])
|
||||||
AC_MSG_CHECKING([for EAC_CTX_init_pace])
|
AC_MSG_CHECKING([for EAC_CTX_init_pace])
|
||||||
AC_TRY_LINK_FUNC(EAC_CTX_init_pace, [ AC_MSG_RESULT([yes]) ], [ AC_MSG_ERROR([OpenPACE not found, use ./configure OPENPACE_LIBS=...]) ])
|
AC_TRY_LINK_FUNC(EAC_CTX_init_pace, [ AC_MSG_RESULT([yes]) ],
|
||||||
|
[ AC_MSG_ERROR([Cannot link against libeac]) ])
|
||||||
|
|
||||||
CPPFLAGS="$saved_CPPFLAGS"
|
CPPFLAGS="$saved_CPPFLAGS"
|
||||||
LIBS="$saved_LIBS"
|
LIBS="$saved_LIBS"
|
||||||
@@ -131,6 +141,7 @@ Preprocessor flags: ${CPPFLAGS}
|
|||||||
Linker flags: ${LDFLAGS}
|
Linker flags: ${LDFLAGS}
|
||||||
Libraries: ${LIBS}
|
Libraries: ${LIBS}
|
||||||
OPENSC_LIBS: ${OPENSC_LIBS}
|
OPENSC_LIBS: ${OPENSC_LIBS}
|
||||||
|
OPENSC_CFLAGS: ${OPENSC_CFLAGS}
|
||||||
OPENSSL_CFLAGS: ${OPENSSL_CFLAGS}
|
OPENSSL_CFLAGS: ${OPENSSL_CFLAGS}
|
||||||
OPENSSL_LIBS: ${OPENSSL_LIBS}
|
OPENSSL_LIBS: ${OPENSSL_LIBS}
|
||||||
OPENPACE_CFLAGS: ${OPENPACE_CFLAGS}
|
OPENPACE_CFLAGS: ${OPENPACE_CFLAGS}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
.. highlight:: sh
|
.. highlight:: sh
|
||||||
|
|
||||||
.. _OpenSC: http://www.opensc-project.org
|
.. _OpenSC: https://github.com/OpenSC/OpenSC
|
||||||
.. _OpenSC with PACE: http://github.com/frankmorgner/OpenSC
|
|
||||||
.. _OpenSSL: http://www.openssl.org
|
.. _OpenSSL: http://www.openssl.org
|
||||||
.. _OpenPACE: http://openpace.sourceforge.net
|
.. _OpenPACE: http://openpace.sourceforge.net
|
||||||
|
|
||||||
@@ -30,8 +29,10 @@ The nPA Smart Card Library offers an easy to use API for the new German identity
|
|||||||
which could also be used for other cards. The included |npa-tool| can
|
which could also be used for other cards. The included |npa-tool| can
|
||||||
be used for PIN management or to send APDUs inside a secure channel.
|
be used for PIN management or to send APDUs inside a secure channel.
|
||||||
|
|
||||||
The nPA Smart Card Library is implemented using OpenPACE_. Some fragments of the
|
The nPA Smart Card Library is implemented using OpenPACE_ and OpenSC_. nPA Smart Card Library
|
||||||
source code are based on the source code of the OpenSC_ tools.
|
implements and initializes Secure Messaging wrappers of OpenSC to allow a
|
||||||
|
transparent SM usage in OpenSC. This allows nPA Smart Card Library to be fully
|
||||||
|
compatible with OpenSC.
|
||||||
|
|
||||||
|
|
||||||
.. _npa-install:
|
.. _npa-install:
|
||||||
@@ -40,61 +41,62 @@ source code are based on the source code of the OpenSC_ tools.
|
|||||||
|
|
||||||
The nPA Smart Card Library has the following dependencies:
|
The nPA Smart Card Library has the following dependencies:
|
||||||
|
|
||||||
- `OpenSC with PACE`_
|
- OpenSSL_
|
||||||
- OpenSSL_ with OpenPACE_
|
- OpenPACE_
|
||||||
|
- OpenSC_
|
||||||
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------------
|
||||||
Hints on OpenSSL with OpenPACE
|
Installation of OpenPACE and OpenSSL
|
||||||
------------------------------
|
------------------------------------
|
||||||
|
|
||||||
The nPA Smart Card Library links against OpenSSL_, which must be patched with
|
The nPA Smart Card Library links against OpenSSL_, which must be patched for OpenPACE_.
|
||||||
OpenPACE_. Here is an example of how to get the standard installation of
|
Here is an example of how to get the standard installation of OpenPACE_ (with
|
||||||
OpenPACE_::
|
the required binaries for OpenSSL)::
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
PREFIX=/tmp/install
|
||||||
OPENPACE=openpace
|
OPENPACE=openpace
|
||||||
svn co https://openpace.svn.sourceforge.net/svnroot/openpace $OPENPACE
|
git clone git://openpace.git.sourceforge.net/gitroot/openpace $OPENPACE
|
||||||
cd $OPENPACE
|
cd $OPENPACE
|
||||||
make patch_with_openpace
|
autoreconf --verbose --install
|
||||||
cd openpace
|
# with `--enable-openssl-install` OpenSSL will be downloaded and installed along with OpenPACE
|
||||||
./config experimental-pace --prefix=$PREFIX
|
./configure --enable-openssl-install --prefix=$PREFIX
|
||||||
make depend
|
make install && cd -
|
||||||
make
|
|
||||||
make install
|
|
||||||
|
|
||||||
Building the nPA Smart Card Library with OpenPACE_ is done best using
|
The file :file:`libcrypto.pc` should be located in ``$INSTALL/lib/pkgconfig``.
|
||||||
:command:`pkg-config`. The file :file:`libcrypto.pc` should be located in
|
|
||||||
``$INSTALL/lib/pkgconfig``. Here is how to configure the nPA Smart Card Library to use
|
|
||||||
it::
|
|
||||||
|
|
||||||
./configure PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
|
||||||
|
|
||||||
|
|
||||||
---------------
|
----------------------
|
||||||
Hints on OpenSC
|
Installation of OpenSC
|
||||||
---------------
|
----------------------
|
||||||
|
|
||||||
The nPA Smart Card Library links against OpenSC, which is discouraged and hindered
|
The nPA Smart Card Library need the OpenSC components to be installed (especially
|
||||||
since OpenSC version >= 0.12. However, I extended OpenSC to support smart card
|
:file:`libopensc.so`). Here is an example of how to get a suitable installation
|
||||||
readers with PACE capabilities. You need the OpenSC components to be installed
|
of OpenSC_::
|
||||||
(especially :file:`libopensc.so`). Here is an example of how to get the
|
|
||||||
standard installation of `OpenSC with PACE`_::
|
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
VSMARTCARD=vsmartcard
|
||||||
OPENSC=opensc
|
git clone git://vsmartcard.git.sourceforge.net/gitroot/vsmartcard $VSMARTCARD
|
||||||
git clone git://github.com/frankmorgner/OpenSC.git $OPENSC
|
cd $VSMARTCARD/npa/src/opensc
|
||||||
cd $OPENSC
|
autoreconf --verbose --install
|
||||||
autoreconf -i
|
|
||||||
# adding PKG_CONFIG_PATH here lets OpenSC use OpenSSL with OpenPACE
|
# adding PKG_CONFIG_PATH here lets OpenSC use OpenSSL with OpenPACE
|
||||||
./configure --prefix=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
./configure --prefix=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
||||||
make
|
make install && cd -
|
||||||
make install
|
|
||||||
|
|
||||||
Now :file:`libopensc.so` should be located in ``$PREFIX/lib``. Here is how to
|
Now :file:`libopensc.so` should be located in ``$PREFIX/lib``.
|
||||||
configure the nPA Smart Card Library to use it::
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
Installation of the nPA Smart Card Library
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
To complete this step-by-step guide, here is how to install nPA Smart Card Library::
|
||||||
|
|
||||||
|
cd $VSMARTCARD/npa
|
||||||
|
autoreconf --verbose --install
|
||||||
|
# adding PKG_CONFIG_PATH here lets OpenSC use OpenSSL with OpenPACE
|
||||||
|
./configure --prefix=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig OPENSC_LIBS="-L$PREFIX/lib -lopensc"
|
||||||
|
make install && cd -
|
||||||
|
|
||||||
./configure OPENSC_LIBS="-L$PREFIX/lib -lopensc"
|
|
||||||
|
|
||||||
|
|
||||||
.. _npa-usage:
|
.. _npa-usage:
|
||||||
@@ -119,27 +121,25 @@ be found in :file:`apdus`.
|
|||||||
Linking against libnpa
|
Linking against libnpa
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
Following the section `Installation`_ above, you have installed `OpenSC with
|
Following the section `Installation`_ above, you have installed OpenSSL_,
|
||||||
PACE`_, OpenPACE_ and the nPA Smart Card Library to :file:`/tmp/install`. To compile a
|
OpenPACE_, OpenSC_ and the nPA Smart Card Library to `$PREFIX` which points to
|
||||||
program using nPA Smart Card Library you need to get the header files from `OpenSC with
|
:file:`/tmp/install`. To compile a program using nPA Smart Card Library you also need
|
||||||
PACE`_ as well. Here is how to compile an external program with these
|
the OpenSC header files, which are located in
|
||||||
libraries::
|
:file:`$VSMARTCARD/npa/src/opensc` Here is how to compile an external program
|
||||||
|
with these libraries::
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
||||||
OPENSC=opensc
|
cc example.c -I$VSMARTCARD/npa/src/opensc \
|
||||||
git clone git://github.com/frankmorgner/OpenSC.git $OPENSC
|
$(pkg-config --cflags --libs npa)
|
||||||
cc example.c -I$OPENSC/src \
|
|
||||||
$(env PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig \
|
|
||||||
pkg-config --cflags --libs npa)
|
|
||||||
|
|
||||||
Alternatively you can specify libraries and flags by hand::
|
Alternatively you can specify libraries and flags by hand::
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
cc example.c -I$VSMARTCARD/npa/src/opensc \
|
||||||
OPENSC=opensc
|
|
||||||
git clone git://github.com/frankmorgner/OpenSC.git $OPENSC
|
|
||||||
cc example.c -I$OPENSC/src \
|
|
||||||
-I$PREFIX/include \
|
-I$PREFIX/include \
|
||||||
-L$PREFIX/lib -lcrypto -lnpa -lopensc"
|
-L$PREFIX/lib -lnpa -lopensc -lcrypto"
|
||||||
|
|
||||||
|
The API to libnpa is documented in :ref:`npa-api`. It includes a simple
|
||||||
|
programming example.
|
||||||
|
|
||||||
|
|
||||||
.. include:: questions.rst
|
.. include:: questions.rst
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
.. highlight:: sh
|
.. highlight:: sh
|
||||||
|
|
||||||
.. _OpenSC: http://www.opensc-project.org
|
.. _OpenSC: https://github.com/OpenSC/OpenSC
|
||||||
.. _OpenSC with PACE: http://github.com/frankmorgner/OpenSC
|
|
||||||
.. _OpenSSL: http://www.openssl.org
|
.. _OpenSSL: http://www.openssl.org
|
||||||
.. _OpenPACE: http://openpace.sourceforge.net
|
.. _OpenPACE: http://openpace.sourceforge.net
|
||||||
|
|
||||||
@@ -42,61 +41,62 @@ compatible with OpenSC.
|
|||||||
|
|
||||||
The @PACKAGE_NAME@ has the following dependencies:
|
The @PACKAGE_NAME@ has the following dependencies:
|
||||||
|
|
||||||
- `OpenSC with PACE`_
|
- OpenSSL_
|
||||||
- OpenSSL_ with OpenPACE_
|
- OpenPACE_
|
||||||
|
- OpenSC_
|
||||||
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------------
|
||||||
Hints on OpenSSL with OpenPACE
|
Installation of OpenPACE and OpenSSL
|
||||||
------------------------------
|
------------------------------------
|
||||||
|
|
||||||
The @PACKAGE_NAME@ links against OpenSSL_, which must be patched with
|
The @PACKAGE_NAME@ links against OpenSSL_, which must be patched for OpenPACE_.
|
||||||
OpenPACE_. Here is an example of how to get the standard installation of
|
Here is an example of how to get the standard installation of OpenPACE_ (with
|
||||||
OpenPACE_::
|
the required binaries for OpenSSL)::
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
PREFIX=/tmp/install
|
||||||
OPENPACE=openpace
|
OPENPACE=openpace
|
||||||
svn co https://openpace.svn.sourceforge.net/svnroot/openpace $OPENPACE
|
git clone git://openpace.git.sourceforge.net/gitroot/openpace $OPENPACE
|
||||||
cd $OPENPACE
|
cd $OPENPACE
|
||||||
make patch_with_openpace
|
autoreconf --verbose --install
|
||||||
cd openpace
|
# with `--enable-openssl-install` OpenSSL will be downloaded and installed along with OpenPACE
|
||||||
./config experimental-pace --prefix=$PREFIX
|
./configure --enable-openssl-install --prefix=$PREFIX
|
||||||
make depend
|
make install && cd -
|
||||||
make
|
|
||||||
make install
|
|
||||||
|
|
||||||
Building the @PACKAGE_NAME@ with OpenPACE_ is done best using
|
The file :file:`libcrypto.pc` should be located in ``$INSTALL/lib/pkgconfig``.
|
||||||
:command:`pkg-config`. The file :file:`libcrypto.pc` should be located in
|
|
||||||
``$INSTALL/lib/pkgconfig``. Here is how to configure the @PACKAGE_NAME@ to use
|
|
||||||
it::
|
|
||||||
|
|
||||||
./configure PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
|
||||||
|
|
||||||
|
|
||||||
---------------
|
----------------------
|
||||||
Hints on OpenSC
|
Installation of OpenSC
|
||||||
---------------
|
----------------------
|
||||||
|
|
||||||
The @PACKAGE_NAME@ links against OpenSC, which is discouraged and hindered
|
The @PACKAGE_NAME@ need the OpenSC components to be installed (especially
|
||||||
since OpenSC version >= 0.12. However, I extended OpenSC to support smart card
|
:file:`libopensc.so`). Here is an example of how to get a suitable installation
|
||||||
readers with PACE capabilities. You need the OpenSC components to be installed
|
of OpenSC_::
|
||||||
(especially :file:`libopensc.so`). Here is an example of how to get the
|
|
||||||
standard installation of `OpenSC with PACE`_::
|
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
VSMARTCARD=vsmartcard
|
||||||
OPENSC=opensc
|
git clone git://vsmartcard.git.sourceforge.net/gitroot/vsmartcard $VSMARTCARD
|
||||||
git clone git://github.com/frankmorgner/OpenSC.git $OPENSC
|
cd $VSMARTCARD/npa/src/opensc
|
||||||
cd $OPENSC
|
autoreconf --verbose --install
|
||||||
autoreconf -i
|
|
||||||
# adding PKG_CONFIG_PATH here lets OpenSC use OpenSSL with OpenPACE
|
# adding PKG_CONFIG_PATH here lets OpenSC use OpenSSL with OpenPACE
|
||||||
./configure --prefix=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
./configure --prefix=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
||||||
make
|
make install && cd -
|
||||||
make install
|
|
||||||
|
|
||||||
Now :file:`libopensc.so` should be located in ``$PREFIX/lib``. Here is how to
|
Now :file:`libopensc.so` should be located in ``$PREFIX/lib``.
|
||||||
configure the @PACKAGE_NAME@ to use it::
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
Installation of the @PACKAGE_NAME@
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
To complete this step-by-step guide, here is how to install @PACKAGE_NAME@::
|
||||||
|
|
||||||
|
cd $VSMARTCARD/npa
|
||||||
|
autoreconf --verbose --install
|
||||||
|
# adding PKG_CONFIG_PATH here lets OpenSC use OpenSSL with OpenPACE
|
||||||
|
./configure --prefix=$PREFIX PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig OPENSC_LIBS="-L$PREFIX/lib -lopensc"
|
||||||
|
make install && cd -
|
||||||
|
|
||||||
./configure OPENSC_LIBS="-L$PREFIX/lib -lopensc"
|
|
||||||
|
|
||||||
|
|
||||||
.. _npa-usage:
|
.. _npa-usage:
|
||||||
@@ -121,27 +121,25 @@ be found in :file:`apdus`.
|
|||||||
Linking against libnpa
|
Linking against libnpa
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
Following the section `Installation`_ above, you have installed `OpenSC with
|
Following the section `Installation`_ above, you have installed OpenSSL_,
|
||||||
PACE`_, OpenPACE_ and the @PACKAGE_NAME@ to :file:`/tmp/install`. To compile a
|
OpenPACE_, OpenSC_ and the @PACKAGE_NAME@ to `$PREFIX` which points to
|
||||||
program using @PACKAGE_NAME@ you need to get the header files from `OpenSC with
|
:file:`/tmp/install`. To compile a program using @PACKAGE_NAME@ you also need
|
||||||
PACE`_ as well. Here is how to compile an external program with these
|
the OpenSC header files, which are located in
|
||||||
libraries::
|
:file:`$VSMARTCARD/npa/src/opensc` Here is how to compile an external program
|
||||||
|
with these libraries::
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
|
||||||
OPENSC=opensc
|
cc example.c -I$VSMARTCARD/npa/src/opensc \
|
||||||
git clone git://github.com/frankmorgner/OpenSC.git $OPENSC
|
$(pkg-config --cflags --libs npa)
|
||||||
cc example.c -I$OPENSC/src \
|
|
||||||
$(env PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig \
|
|
||||||
pkg-config --cflags --libs npa)
|
|
||||||
|
|
||||||
Alternatively you can specify libraries and flags by hand::
|
Alternatively you can specify libraries and flags by hand::
|
||||||
|
|
||||||
PREFIX=/tmp/install
|
cc example.c -I$VSMARTCARD/npa/src/opensc \
|
||||||
OPENSC=opensc
|
|
||||||
git clone git://github.com/frankmorgner/OpenSC.git $OPENSC
|
|
||||||
cc example.c -I$OPENSC/src \
|
|
||||||
-I$PREFIX/include \
|
-I$PREFIX/include \
|
||||||
-L$PREFIX/lib -lcrypto -lnpa -lopensc"
|
-L$PREFIX/lib -lnpa -lopensc -lcrypto"
|
||||||
|
|
||||||
|
The API to libnpa is documented in :ref:`npa-api`. It includes a simple
|
||||||
|
programming example.
|
||||||
|
|
||||||
|
|
||||||
.. include:: questions.rst
|
.. include:: questions.rst
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
.. highlight:: c
|
.. highlight:: c
|
||||||
|
|
||||||
|
.. _npa-api:
|
||||||
|
|
||||||
********************************
|
********************************
|
||||||
Programming with the nPA Library
|
Programming with the nPA Library
|
||||||
********************************
|
********************************
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
.. highlight:: sh
|
.. highlight:: sh
|
||||||
|
|
||||||
=============
|
============
|
||||||
Installation
|
Installation
|
||||||
=============
|
============
|
||||||
|
|
||||||
The nPA Smart Card Library uses the GNU Build System to compile and install. If you are
|
The nPA Smart Card Library uses the GNU Build System to compile and install. If you are
|
||||||
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
||||||
@@ -10,7 +10,7 @@ around and can not find it, you are probably working bleeding edge in the
|
|||||||
repository. Run the following command in :file:`npa` to
|
repository. Run the following command in :file:`npa` to
|
||||||
get the missing standard auxiliary files::
|
get the missing standard auxiliary files::
|
||||||
|
|
||||||
autoreconf -i
|
autoreconf --verbose --install
|
||||||
|
|
||||||
To configure (:command:`configure --help` lists possible options), build and
|
To configure (:command:`configure --help` lists possible options), build and
|
||||||
install the nPA Smart Card Library now do the following::
|
install the nPA Smart Card Library now do the following::
|
||||||
|
|||||||
@@ -14,20 +14,18 @@ MAINTAINERCLEANFILES = $(BUILT_SOURCES) npa-tool.ggo $(dist_man1_MANS)
|
|||||||
|
|
||||||
dist_man1_MANS = npa-tool.1
|
dist_man1_MANS = npa-tool.1
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/src/opensc/src -DENABLE_SM
|
|
||||||
|
|
||||||
libnpa_la_SOURCES = iso-sm.c scutil.c npa.c
|
libnpa_la_SOURCES = iso-sm.c scutil.c npa.c
|
||||||
libnpa_la_LIBADD = $(OPENSSL_LIBS) $(OPENPACE_LIBS) $(OPENSC_LIBS)
|
libnpa_la_LIBADD = $(OPENSSL_LIBS) $(OPENPACE_LIBS) $(OPENSC_LIBS)
|
||||||
libnpa_la_CFLAGS = $(OPENSSL_CFLAGS) $(OPENPACE_CFLAGS)
|
libnpa_la_CFLAGS = $(OPENSSL_CFLAGS) $(OPENPACE_CFLAGS) $(OPENSC_CFLAGS)
|
||||||
libnpa_la_LDFLAGS = -no-undefined
|
libnpa_la_LDFLAGS = -no-undefined
|
||||||
|
|
||||||
npa_tool_SOURCES = npa-tool.c $(BUILT_SOURCES)
|
npa_tool_SOURCES = npa-tool.c $(BUILT_SOURCES)
|
||||||
npa_tool_LDADD = $(OPENSSL_LIBS) $(OPENPACE_LIBS) $(OPENSC_LIBS) libnpa.la
|
npa_tool_LDADD = $(OPENSSL_LIBS) $(OPENPACE_LIBS) $(OPENSC_LIBS) libnpa.la
|
||||||
npa_tool_CFLAGS = $(OPENSSL_CFLAGS) $(OPENPACE_CFLAGS)
|
npa_tool_CFLAGS = $(OPENSSL_CFLAGS) $(OPENPACE_CFLAGS) $(OPENSC_CFLAGS)
|
||||||
|
|
||||||
example_SOURCES = example.c
|
example_SOURCES = example.c
|
||||||
example_LDADD = $(OPENSSL_LIBS) $(OPENPACE_LIBS) $(OPENSC_LIBS) libnpa.la
|
example_LDADD = $(OPENSSL_LIBS) $(OPENPACE_LIBS) $(OPENSC_LIBS) libnpa.la
|
||||||
example_CFLAGS = $(OPENSSL_CFLAGS) $(OPENPACE_CFLAGS)
|
example_CFLAGS = $(OPENSSL_CFLAGS) $(OPENPACE_CFLAGS) $(OPENSC_CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
npa-tool.c: $(BUILT_SOURCES)
|
npa-tool.c: $(BUILT_SOURCES)
|
||||||
|
|||||||
1
npa/src/opensc
Submodule
1
npa/src/opensc
Submodule
Submodule npa/src/opensc added at f6db9196d2
@@ -1,8 +1,8 @@
|
|||||||
.. highlight:: sh
|
.. highlight:: sh
|
||||||
|
|
||||||
=============
|
============
|
||||||
Installation
|
Installation
|
||||||
=============
|
============
|
||||||
|
|
||||||
The PC/SC Relay uses the GNU Build System to compile and install. If you are
|
The PC/SC Relay uses the GNU Build System to compile and install. If you are
|
||||||
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
||||||
@@ -10,7 +10,7 @@ around and can not find it, you are probably working bleeding edge in the
|
|||||||
repository. Run the following command in :file:`pcsc-relay` to
|
repository. Run the following command in :file:`pcsc-relay` to
|
||||||
get the missing standard auxiliary files::
|
get the missing standard auxiliary files::
|
||||||
|
|
||||||
autoreconf -i
|
autoreconf --verbose --install
|
||||||
|
|
||||||
To configure (:command:`configure --help` lists possible options), build and
|
To configure (:command:`configure --help` lists possible options), build and
|
||||||
install the PC/SC Relay now do the following::
|
install the PC/SC Relay now do the following::
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
.. highlight:: sh
|
.. highlight:: sh
|
||||||
|
|
||||||
=============
|
============
|
||||||
Installation
|
Installation
|
||||||
=============
|
============
|
||||||
|
|
||||||
The Virtual Smart Card uses the GNU Build System to compile and install. If you are
|
The Virtual Smart Card uses the GNU Build System to compile and install. If you are
|
||||||
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
unfamiliar with it, please have a look at :file:`INSTALL`. If you have a look
|
||||||
@@ -10,7 +10,7 @@ around and can not find it, you are probably working bleeding edge in the
|
|||||||
repository. Run the following command in :file:`virtualsmartcard` to
|
repository. Run the following command in :file:`virtualsmartcard` to
|
||||||
get the missing standard auxiliary files::
|
get the missing standard auxiliary files::
|
||||||
|
|
||||||
autoreconf -i
|
autoreconf --verbose --install
|
||||||
|
|
||||||
To configure (:command:`configure --help` lists possible options), build and
|
To configure (:command:`configure --help` lists possible options), build and
|
||||||
install the Virtual Smart Card now do the following::
|
install the Virtual Smart Card now do the following::
|
||||||
|
|||||||
Reference in New Issue
Block a user