示例#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)
示例#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())
示例#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="******")
示例#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")
示例#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="******")