+
+ def test_verify(self):
+ orig_cert = CertStub('test', 'www.test.com', self.tmpdir)
+ self.ca.create()
+ self.ca.generate(orig_cert)
+
+ alt_ca = CAStub({'cn': 'test ca', 'org': 'test',
+ 'bits': '1024', 'email': 'test@test.com'},
+ password='testpw')
+ alt_ca.ca.create()
+ alt_cert = CertStub('test', 'www.test.com', alt_ca.tmpdir)
+ alt_ca.ca.generate(alt_cert)
+
+ self.assertTrue(self.ca.verify(orig_cert.public_key_file))
+ self.assertTrue(alt_ca.ca.verify(alt_cert.public_key_file))
+ self.assertFalse(self.ca.verify(alt_cert.public_key_file))
+ self.assertFalse(alt_ca.ca.verify(orig_cert.public_key_file))
+
+ alt_ca.destroy()