-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmartcard.py
More file actions
38 lines (28 loc) · 787 Bytes
/
smartcard.py
File metadata and controls
38 lines (28 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python
#
# smartcard functions
#
def getReaderName():
return "Gemalto PC Twin Reader"
#'Fujitsu Siemens Computers SmartCard USB 2A'
def getSmartcardName():
return "altinn - Buypass" #'Keine Smartcard' #'HU-CA Smartcard for Matthias Bock'
import bobo
def is_present():
return True
def not_present():
reader = getReaderName()
return open('smartcard/not_present.html').read() % (reader)
def is_locked():
return False
def enter_pin():
return open('smartcard/enter_pin.html').read() % (getReaderName(), getSmartcardName())
@bobo.query('/smartcard.py')
def smartcard():
if is_present():
if is_locked():
return enter_pin()
else:
return open('smartcard/details.html').read() % (getReaderName(), getSmartcardName(), 'Bereit')
else:
return not_present()