Example #1
0
 def setUp(self):
     self.pubkey = top.get_key(
         top.parse(
             pkg_resources.resource_stream(__name__,
                                           KEY_FILE_PAIRS[0][1]).read()))
     self.privkey = top.get_key(
         top.parse(
             pkg_resources.resource_stream(__name__,
                                           KEY_FILE_PAIRS[0][0]).read()))
Example #2
0
 def test_rsa_dict_to_key(self):
     data = pkg_resources.resource_stream(__name__, KEY_FILE_PAIRS[0][0]).read()
     rsa_dict = top.parse(data)
     key = top.get_key(rsa_dict)
     self.assertTrue(key)
     self.assertTrue(key.e)
     self.assertTrue(key.d)
Example #3
0
 def test_x509_dict_to_key(self):
     data = pkg_resources.resource_stream(__name__, KEY_FILE_PAIRS[0][1]).read()
     x509_dict = top.parse(data)
     key = top.get_key(x509_dict)
     self.assertTrue(key)
     self.assertTrue(key.e)
     # "lambda" suppresses exception until called by the test handler
     self.assertRaises(AttributeError, lambda: key.d)
Example #4
0
 def setUp(self):
     self.pubkey = top.get_key(top.parse(pkg_resources.resource_stream(__name__, KEY_FILE_PAIRS[0][1]).read()))
     self.privkey = top.get_key(top.parse(pkg_resources.resource_stream(__name__, KEY_FILE_PAIRS[0][0]).read()))