Authentication with NDEF message on Desfire containing signed UID via Ed25519

This commit is contained in:
Ondrej Mikle 2017-10-22 22:39:55 +02:00
parent 892b69f939
commit d0121aaed9
12 changed files with 286 additions and 41 deletions

View file

@ -1,5 +1,4 @@
import time
import wiringpi2 as wiringpi
class Unlocker(object):
"""Abstract class/interface for Unlocker object.
@ -35,14 +34,16 @@ class UnlockerWiringPi(Unlocker):
"""
def __init__(self, config):
import wiringpi2 as wiringpi
Unlocker.__init__(self, config)
wiringpi.wiringPiSetupGpio() # pin numbers follow P1 GPIO header
wiringpi.wiringPiSetupGpio() # pin numbers follow P1 GPIO header
self.lockPin = self.config.getint("UnlockerWiringPi", "lock_pin")
wiringpi.pinMode(self.lockPin, 1) #output
def unlock(self):
"""Unlocks lock at configured pin by pulling it high.
"""
import wiringpi2 as wiringpi
wiringpi.digitalWrite(self.lockPin, 1)
time.sleep(self.lockOpenedSecs)
wiringpi.digitalWrite(self.lockPin, 0)
@ -52,5 +53,6 @@ class UnlockerWiringPi(Unlocker):
Lock the lock back. Meant to be used when program is shut down
so that lock is not left disengaged.
"""
import wiringpi2 as wiringpi
wiringpi.digitalWrite(self.lockPin, 0)