def test_malformed_key(self): try: crypto.save_key(self.private, "id_rsa") private = crypto.load_key( open_read("id_rsa").read().replace("PRIVATE", "")) self.assertEqual(1, 2) except: #should crash self.assertEqual(1, 1)
def test_save_load_keys_text(self): crypto.save_key(self.private, "id_rsa") crypto.save_key(self.public, "id_rsa.pub") public = crypto.load_key(open_read("id_rsa.pub").read()) private = crypto.load_key(open_read("id_rsa").read())
def test_save_load_keys_encrypted(self): crypto.save_key(self.private, "id_rsa_c", key_password="******") private = crypto.load_key("id_rsa_c", key_password="******")
def test_save_load_keys(self): crypto.save_key(self.private, "id_rsa") crypto.save_key(self.public, "id_rsa.pub") public = crypto.load_key("id_rsa.pub") private = crypto.load_key("id_rsa")
def test_save_load_keys_text_encrypted(self): crypto.save_key(self.private, "id_rsa_c", key_password="******") private = crypto.load_key(open_read("id_rsa_c").read(), key_password="******")