コード例 #1
0
 def from_key(self, public_id, key):
     """
     Return what the YubiKey would have returned when the button was pressed.
     """
     otp = self.get_otp(key)
     from_key = modhex_encode(public_id.encode('hex')) + modhex_encode(otp.encode('hex'))
     return from_key
コード例 #2
0
 def from_key(self, public_id, key):
     """
     Return what the YubiKey would have returned when the button was pressed.
     """
     otp = self.get_otp(key)
     from_key = modhex_encode(public_id.encode('hex')) + modhex_encode(
         otp.encode('hex'))
     return from_key
コード例 #3
0
 def test_modhex_encode_decode(self):
     """ Test modhex encoding/decoding. """
     h = '4d014d024d4ddd5382b11195144da07d'
     self.assertEquals(h, modhex_decode(modhex_encode(h)))
コード例 #4
0
 def test_modhex_encode_decode(self):
     """ Test modhex encoding/decoding. """
     h = '4d014d024d4ddd5382b11195144da07d'
     self.assertEquals(h, modhex_decode( modhex_encode(h) ) )