Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
    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())
Exemplo n.º 3
0
 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="******")
Exemplo n.º 4
0
    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")
Exemplo n.º 5
0
 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="******")