Esempio n. 1
0
 def setUp(self):
     ber = b64decode('kQqQyoq7/uC+JAAScR6fGAQAAAABhhWEJAACECLDCJ81BkwUJEfxH6LsCqGKAjAw')
     el = []
     while ber:
         y, ber = pber_dec(ber)
         if y:
             el.append(y)
     self.el = el
Esempio n. 2
0
 def setUp(self):
     ber = b64decode(
         'kQqQyoq7/uC+JAAScR6fGAQAAAABhhWEJAACECLDCJ81BkwUJEfxH6LsCqGKAjAw')
     el = []
     while ber:
         y, ber = pber_dec(ber)
         if y:
             el.append(y)
     self.el = el
Esempio n. 3
0
 def test_decode0x71(self):
     input = '711e9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa1'
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(
         res,
         IssuerScriptTemplate1(
             hexvalue=
             '9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa1')
     )
     self.assertEqual(remain, b'')
 def test_chain(self):
     input = '910a90ca8abbfee0be240012711e9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa18a023030'
     subs = unhexlify(input)
     l = []
     while subs:
         res, subs = pber_dec(subs)
         if res:
             l.append(res)
     self.assertEqual(l, [IssuerAuthenticationData(hexvalue='90ca8abbfee0be240012'),
                           IssuerScriptTemplate1(hexvalue='9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa1'),
                           AuthorisationResponseCode(hexvalue='3030')])
Esempio n. 5
0
 def test_chain(self):
     input = '910a90ca8abbfee0be240012711e9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa18a023030'
     subs = unhexlify(input)
     l = []
     while subs:
         res, subs = pber_dec(subs)
         if res:
             l.append(res)
     self.assertEqual(l, [
         IssuerAuthenticationData(hexvalue='90ca8abbfee0be240012'),
         IssuerScriptTemplate1(
             hexvalue=
             '9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa1'
         ),
         AuthorisationResponseCode(hexvalue='3030')
     ])
Esempio n. 6
0
 def test_decode0x8a(self):
     input = '8a023030'
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(res, AuthorisationResponseCode(hexvalue='3030'))
     self.assertEqual(remain, b'')
Esempio n. 7
0
 def test_decode0x91(self):
     input = '910a90ca8abbfee0be240012'
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(
         res, IssuerAuthenticationData(hexvalue='90ca8abbfee0be240012'))
     self.assertEqual(remain, b'')
Esempio n. 8
0
 def test_decodelong(self):
     input = '8a820101' + '00' * 257
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(res, AuthorisationResponseCode(hexvalue='00' * 257))
 def test_decodelong(self):
     input = '8a820101' + '00' * 257
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(res, AuthorisationResponseCode(hexvalue='00' * 257))
Esempio n. 10
0
 def test_decode0x8a(self):
     input = '8a023030'
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(res, AuthorisationResponseCode(hexvalue='3030'))
     self.assertEqual(remain, b'')
Esempio n. 11
0
 def test_decode0x71(self):
     input = '711e9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa1'
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(res, IssuerScriptTemplate1(hexvalue='9f1804000000018615842400021022c3089f35064c142447f11fa2ec0aa1'))
     self.assertEqual(remain, b'')
Esempio n. 12
0
 def test_decode0x91(self):
     input = '910a90ca8abbfee0be240012'
     res, remain = pber_dec(unhexlify(input))
     self.assertEqual(res, IssuerAuthenticationData(hexvalue='90ca8abbfee0be240012'))
     self.assertEqual(remain, b'')