Skip to content

Commit 95778bc

Browse files
author
jdaussel
committed
Initial import
0 parents  commit 95778bc

File tree

140 files changed

+18577
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+18577
-0
lines changed

LICENSE

+457
Large diffs are not rendered by default.

MANIFEST.in

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
include LICENSE
2+
include MANIFEST.in
3+
include README
4+
include smartcard/ACKS
5+
include smartcard/ChangeLog
6+
include smartcard/LICENSE
7+
include smartcard/README
8+
include smartcard/TODO
9+
include smartcard/scard/gemalto.ver
10+
include smartcard/scard/helpers.c
11+
include smartcard/scard/helpers.h
12+
include smartcard/scard/memlog.h
13+
include smartcard/scard/PcscDefs.i
14+
include smartcard/scard/PcscTypemaps.i
15+
include smartcard/scard/scard.def
16+
include smartcard/scard/scard.i
17+
include smartcard/scard/scard.rc
18+
include smartcard/scard/winscarddll.c
19+
include smartcard/scard/winscarddll.h
20+
recursive-include smartcard/wx *.ico
21+
recursive-include smartcard/Examples *.txt *.py *.ico
22+
include smartcard/test/configcheck.py
23+
recursive-include smartcard/test/framework *.txt *.py
24+
recursive-include smartcard/test/frameworkpcsc *.txt *.py
25+
recursive-include smartcard/test/scard *.txt *.py
26+
recursive-include smartcard/doc *.html *.jpg *.css *.js *.png *.txt
27+
28+
29+

PKG-INFO

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Metadata-Version: 1.0
2+
Name: pyscard
3+
Version: 1.6.0
4+
Summary: Smartcard module for Python.
5+
Home-page: http://www.gemalto.com
6+
Author: Jean-Daniel Aussel
7+
Author-email: [email protected]
8+
License: GNU LESSER GENERAL PUBLIC LICENSE
9+
Download-URL: http://www.gemalto.com/pyscard-1.6.0.zip
10+
Description: Smartcard package for Python
11+
Platform: linux
12+
Platform: win32
13+
Classifier: Development Status :: 1.6.0 - Release
14+
Classifier: License :: GNU LESSER GENERAL PUBLIC LICENSE
15+
Classifier: Intended Audience :: Developers
16+
Classifier: Operating System :: Unix
17+
Classifier: Operating System :: Microsoft :: Windows
18+
Classifier: Topic :: Security :: Smartcards

README

+207
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
-------------------------------------------------------------------------------
2+
pyscard smartcard library for python
3+
-------------------------------------------------------------------------------
4+
http://pyscard.sourceforge.net/
5+
-------------------------------------------------------------------------------
6+
7+
Copyright 2001-2007 gemalto
8+
Author: Jean-Daniel Aussel, mailto:[email protected]
9+
10+
This file is part of pyscard.
11+
12+
pyscard is free software; you can redistribute it and/or modify it under
13+
the terms of the GNU Lesser General Public License as published by the Free
14+
Software Foundation; either version 2.1 of the License, or (at your option) any
15+
later version.
16+
17+
pyscard is distributed in the hope that it will be useful, but WITHOUT ANY
18+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19+
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
20+
21+
You should have received a copy of the GNU Lesser General Public License along
22+
with pyscard; if not, write to the Free Software Foundation, Inc., 51
23+
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24+
25+
-------------------------------------------------------------------------------
26+
Last update : pyscard 1.6.0 (May 2007)
27+
-------------------------------------------------------------------------------
28+
29+
pyscard is a python module adding smart cards support to python.
30+
31+
It consists of the smartcard.scard module, an extension module wrapping Windows
32+
smart card base components (also known as PCSC) on Windows, and PCSC lite on
33+
linux, and of the smartcard module, a python framework hiding PCSC complexity.
34+
35+
36+
-------------------------------------------------------------------------------
37+
Documentation
38+
-------------------------------------------------------------------------------
39+
40+
All documentation is provided in the smartcard/doc directory of the source
41+
distribution. Examples are provided in the smartcard/Examples directory of the
42+
source distribution. The binary distribution does not include any
43+
documentation, tests scripts or examples.
44+
45+
46+
-------------------------------------------------------------------------------
47+
Installation
48+
-------------------------------------------------------------------------------
49+
50+
The pyscard library is packaged using the standard distutils python module.
51+
52+
Installation on windows
53+
-----------------------
54+
55+
Installing on windows from the binary distribution
56+
--------------------------------------------------
57+
58+
1. download the binary msi installer or self-executable installer
59+
2. execute the installer
60+
61+
The binary msi installer and self-executable installer are packaged for a
62+
specific version of python, and have name similar to
63+
pyscard-1.6.0.win32-py2.5.msi and pyscard-1.6.0.win32-py2.5.exe for
64+
python 2.5.
65+
66+
67+
Installing on windows from the source distribution
68+
---------------------------------------------------
69+
70+
1. you will need swig 1.3.31 from http://www.swig.org, and a C compiler.
71+
72+
By default, Visual Studio 2003 is required for building the c language wrapper
73+
for python 2.5, and Visual Studio .Net or VisualC++ 6 for python 2.4. You might
74+
use another release by fiddling with the python/Lib/distutils/msvccompiler.py
75+
file that detects the compiler.
76+
77+
2. download the source distribution
78+
79+
The source distribution is available as pyscard-1.6.0.zip for windows,
80+
and pyscard-1.6.0.tar.gz for linux.
81+
82+
3. unzip the source distribution, open a console and type the following:
83+
84+
setup.py build_ext install
85+
86+
This will build pyscard and install it in the site-packages directory of
87+
your python distribution, e.g. c:\python25\Lib\site-packages\smartcard.
88+
89+
This install procedure does not install the documentation, examples or test
90+
files.
91+
92+
Installation on linux:
93+
----------------------
94+
95+
Installing on linux from the binary distribution:
96+
-------------------------------------------------
97+
98+
1. download the binary distribution
99+
100+
The binary distribution is either an archive file or a rpm file, with
101+
names similar to pyscard-1.6.0-1.i386.rpm for the rpm distribution,
102+
or pyscard-1.6.0.linux-i686.tar.gz for the archive distribution.
103+
104+
2. untar the binary distribution
105+
106+
With root privilege from a terminal, extract the archive from /, or
107+
install the rpm.
108+
109+
Installing on linux from the source distribution
110+
------------------------------------------------
111+
112+
1. you will need gcc, swig 1.3.31 (http://www.swig.org), and pcsc-lite
113+
(http://pcsclite.alioth.debian.org/)
114+
115+
2. download the source distribution
116+
117+
The source distribution is available as pyscard-1.6.0.zip or
118+
pyscard-1.6.0.tar.gz.
119+
120+
3. untar the source distribution
121+
122+
4. from a terminal with root privileges, type the following:
123+
124+
/usr/bin/python setup.py build_ext install
125+
126+
This will build pyscard and install it in the site-packages directory of
127+
your python distribution, e.g. /usr/lib/python2.4/site-packages/smartcard.
128+
129+
130+
-------------------------------------------------------------------------------
131+
Developer documentation, unit tests and examples
132+
-------------------------------------------------------------------------------
133+
The developer documentation is in the smartcard/doc directory of the source
134+
distribution.
135+
136+
Examples are located in the smartcard/Examples directory, and the pyunit unit
137+
tests in the smartcard/test directory.
138+
139+
-------------------------------------------------------------------------------
140+
Build instructions for packagers
141+
-------------------------------------------------------------------------------
142+
143+
Building a binary distribution for Windows
144+
------------------------------------------
145+
146+
To build a binary distribution from the source distribution, you will need a C
147+
compiler and swig 1.3.31 (same requirements as for installing from the source
148+
distribution).
149+
150+
In the root directory of the source distribution, execute the following command
151+
in a console:
152+
153+
setup.py build_ext bdist_msi
154+
setup.py build_ext bdist_wininst
155+
156+
This will build the msi installer and self-executable installer in the dist
157+
directory, with names similar to pyscard-1.6.0.win32-py2.5.msi and
158+
pyscard-1.6.0.win32-py2.5.exe for python 2.5, and
159+
pyscard-1.6.0.win32-py2.4.msi and pyscard-1.6.0.win32-py2.4.exe for
160+
python 2.4.
161+
162+
Building a binary distribution for linux
163+
----------------------------------------
164+
165+
To build a binary distribution from the source distribution, you will need
166+
gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from the
167+
source distribution).
168+
169+
In the root directory of the source distribution, execute the following
170+
command in a terminal:
171+
172+
/usr/bin/python setup.py build_ext bdist
173+
174+
This will build a package similar to pyscard-1.6.0.linux-i686.tar.gz
175+
containing a tree
176+
177+
Building a rpm distribution for linux
178+
----------------------------------------
179+
180+
To build a rpm distribution from the source distribution, you will need
181+
gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from the
182+
source distribution).
183+
184+
In the root directory of the source distribution, execute the following
185+
command in a terminal:
186+
187+
/usr/bin/python setup.py build bdist_rpm
188+
189+
If you have rpm 4.1 or above, you will need to add the
190+
%_unpackaged_files_terminate_build 0 options to the /etc/rpm/macros file,
191+
e.g.:
192+
193+
echo "%_unpackaged_files_terminate_build 0" >> /etc/rpm/macros
194+
195+
This will build in the dist directory a binary distribution with a name
196+
similar to pyscard-1.6.0-1.i386.rpm.
197+
198+
199+
-------------------------------------------------------------------------------
200+
Issue Tracking
201+
-------------------------------------------------------------------------------
202+
If you encounter a bug, please report it in the SourceForge bug tracker at
203+
http://sourceforge.net/tracker/?group_id=196342&atid=957072
204+
https://sourceforge.net/tracker/?group_id=196342&atid=957072
205+
206+
207+
-jda

setup.py

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#! /usr/bin/env python
2+
"""Setup file for distutils
3+
4+
__author__ = "http://www.gemalto.com"
5+
6+
Copyright 2001-2007 gemalto
7+
Author: Jean-Daniel Aussel, mailto:[email protected]
8+
9+
This file is part of pyscard.
10+
11+
pyscard is free software; you can redistribute it and/or modify
12+
it under the terms of the GNU Lesser General Public License as published by
13+
the Free Software Foundation; either version 2.1 of the License, or
14+
(at your option) any later version.
15+
16+
pyscard is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU Lesser General Public License for more details.
20+
21+
You should have received a copy of the GNU Lesser General Public License
22+
along with pyscard; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24+
"""
25+
26+
from distutils import core
27+
from distutils.core import Extension
28+
from distutils.util import get_platform
29+
from distutils.command.build_ext import build_ext
30+
import glob, os, sys
31+
32+
if sys.version[0:1] == '1':
33+
raise RuntimeError, ("pyscard requires Python 2.x to build.")
34+
35+
if 'win32'==get_platform():
36+
platform__cc_defines=[('WIN32', '100')]
37+
platform_swig_opts=['-DWIN32']
38+
platform_sources=['smartcard/scard/scard.rc']
39+
platform_libraries=['winscard']
40+
platform_include_dirs=[]
41+
platform_extra_compile_args=[]
42+
platform_extra_link_args=[]
43+
elif 'linux-i586'==get_platform() or 'linux-i686'==get_platform():
44+
platform__cc_defines=[('PCSCLITE', '1')]
45+
platform_swig_opts=['-DPCSCLITE']
46+
platform_sources=[]
47+
platform_libraries=['pcsclite']
48+
platform_include_dirs=['/usr/include/PCSC']
49+
platform_extra_compile_args=[]#['-ggdb', '-O0']
50+
platform_extra_link_args=[]#['-ggdb']
51+
else:
52+
platform_cc_defines=[]
53+
platform_sources=[]
54+
platform_swig_opts=[]
55+
platform_libraries=[]
56+
platform_include_dirs=[]
57+
platform_extra_compile_args=[]
58+
platform_extra_link_args=[]
59+
60+
61+
kw = {'name':"pyscard",
62+
'version':"1.6.0",
63+
'description':"Smartcard module for Python.",
64+
'author':"Jean-Daniel Aussel",
65+
'author_email':"[email protected]",
66+
'url':"http://www.gemalto.com",
67+
'long_description':'Smartcard package for Python',
68+
'license':'GNU LESSER GENERAL PUBLIC LICENSE',
69+
'platforms':['linux','win32'],
70+
'packages' : [ "smartcard",
71+
"smartcard/pcsc",
72+
"smartcard/reader",
73+
"smartcard/scard",
74+
"smartcard/sw",
75+
"smartcard/util",
76+
"smartcard/wx",
77+
],
78+
'package_dir' : { "":"." },
79+
'package_data' : {
80+
"smartcard" : [
81+
"ACKS",
82+
"ChangeLog",
83+
"LICENSE",
84+
"README",
85+
"TODO",
86+
],
87+
"smartcard/wx" : ["resources/*.ico"],
88+
} ,
89+
90+
# the _scard.pyd extension to build
91+
'ext_modules':[Extension("smartcard.scard._scard",
92+
define_macros=platform__cc_defines,
93+
include_dirs=['smartcard/scard/']+platform_include_dirs,
94+
sources=["smartcard/scard/helpers.c",
95+
"smartcard/scard/winscarddll.c",
96+
"smartcard/scard/scard.i"]+platform_sources,
97+
libraries=platform_libraries,
98+
extra_compile_args=platform_extra_compile_args,
99+
extra_link_args=platform_extra_link_args,
100+
swig_opts=['-outdir','smartcard/scard']+platform_swig_opts)],
101+
}
102+
103+
# If we're running >Python 2.3, add extra information
104+
if hasattr(core, 'setup_keywords'):
105+
if 'classifiers' in core.setup_keywords:
106+
kw['classifiers'] = [
107+
'Development Status :: 1.6.0 - Release',
108+
'License :: GNU LESSER GENERAL PUBLIC LICENSE',
109+
'Intended Audience :: Developers',
110+
'Operating System :: Unix',
111+
'Operating System :: Microsoft :: Windows',
112+
'Topic :: Security :: Smartcards',
113+
]
114+
if 'download_url' in core.setup_keywords:
115+
kw['download_url'] = ('http://www.gemalto.com/'
116+
'%s-%s.zip' % (kw['name'], kw['version']) )
117+
118+
core.setup(**kw)
119+

smartcard/ACKS

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Acknowledgements
2+
----------------
3+
4+
This list is sorted in alphabetical order, and is probably incomplete.
5+
I'd like to thank everybody who contributed in any way, with code, bug
6+
reports, and comments.
7+
8+
-jda
9+
10+
Michel Beziat
11+
Antonio Aranda
12+
Nodir Gylianov
13+
Luc Duche
14+

0 commit comments

Comments
 (0)