Пример #1
0
 def test_figure7(self):
     doc = PSKCDocument(os.path.join(basename, "pskc-figure7.xml"))
     assert doc.keyname == 'My Password 1'
     doc.setKey('qwerty')
     assert [(t.id, t.options) for t in doc.getKeyPackages()] == \
         [(u'123456', {
             'ipatokenotpkey': u'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',
             'ipatokenvendor': u'TokenVendorAcme',
             'ipatokenserial': u'987654321',
             'ipatokenotpdigits': 8,
             'type': u'hotp'})]
Пример #2
0
 def test_figure7(self):
     doc = PSKCDocument(os.path.join(basename, "pskc-figure7.xml"))
     assert doc.keyname == 'My Password 1'
     doc.setKey(b'qwerty')
     assert [(t.id, t.options) for t in doc.getKeyPackages()] == \
         [(u'123456', {
             'ipatokenotpkey': u'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',
             'ipatokenvendor': u'TokenVendorAcme',
             'ipatokenserial': u'987654321',
             'ipatokenotpdigits': 8,
             'type': u'hotp'})]
Пример #3
0
 def test_figure6(self):
     doc = PSKCDocument(os.path.join(basename, "pskc-figure6.xml"))
     assert doc.keyname == 'Pre-shared-key'
     doc.setKey('12345678901234567890123456789012'.decode('hex'))
     assert [(t.id, t.options) for t in doc.getKeyPackages()] == \
         [(u'12345678', {
             'ipatokenotpkey': u'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',
             'ipatokenvendor': u'Manufacturer',
             'ipatokenserial': u'987654321',
             'ipatokenhotpcounter': 0,
             'ipatokenotpdigits': 8,
             'type': u'hotp'})]
Пример #4
0
 def test_figure6(self):
     doc = PSKCDocument(os.path.join(basename, "pskc-figure6.xml"))
     assert doc.keyname == 'Pre-shared-key'
     doc.setKey(codecs.decode('12345678901234567890123456789012', 'hex'))
     assert [(t.id, t.options) for t in doc.getKeyPackages()] == \
         [(u'12345678', {
             'ipatokenotpkey': u'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',
             'ipatokenvendor': u'Manufacturer',
             'ipatokenserial': u'987654321',
             'ipatokenhotpcounter': 0,
             'ipatokenotpdigits': 8,
             'type': u'hotp'})]
Пример #5
0
 def test_figure7(self):
     nss.nss_init_nodb()
     try:
         doc = PSKCDocument(os.path.join(basename, "pskc-figure7.xml"))
         assert doc.keyname == "My Password 1"
         doc.setKey("qwerty")
         assert [(t.id, t.options) for t in doc.getKeyPackages()] == [
             (
                 u"123456",
                 {
                     "ipatokenotpkey": u"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
                     "ipatokenvendor": u"TokenVendorAcme",
                     "ipatokenserial": u"987654321",
                     "ipatokenotpdigits": 8,
                     "type": u"hotp",
                 },
             )
         ]
     finally:
         nss.nss_shutdown()
Пример #6
0
 def test_figure6(self):
     nss.nss_init_nodb()
     try:
         doc = PSKCDocument(os.path.join(basename, "pskc-figure6.xml"))
         assert doc.keyname == "Pre-shared-key"
         doc.setKey("12345678901234567890123456789012".decode("hex"))
         assert [(t.id, t.options) for t in doc.getKeyPackages()] == [
             (
                 u"12345678",
                 {
                     "ipatokenotpkey": u"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
                     "ipatokenvendor": u"Manufacturer",
                     "ipatokenserial": u"987654321",
                     "ipatokenhotpcounter": 0,
                     "ipatokenotpdigits": 8,
                     "type": u"hotp",
                 },
             )
         ]
     finally:
         nss.nss_shutdown()