def handle(self): with tutils.tmpdir() as d: ca1 = certutils.CertStore.from_store(d, "test2") ca2 = certutils.CertStore.from_store(d, "test3") cert, _ = ca1.get_cert("foo.com", []) certffi.set_flags(ca2.privkey, 0) self.convert_to_ssl(cert, ca2.privkey)
def handle(self): with tutils.tmpdir() as d: ca1 = certutils.CertStore.from_store(d, "test2") ca2 = certutils.CertStore.from_store(d, "test3") cert, _, _ = ca1.get_cert("foo.com", []) certffi.set_flags(ca2.default_privatekey, 0) self.convert_to_ssl(cert, ca2.default_privatekey)
def test_gen_pkey(self): try: with tutils.tmpdir() as d: ca1 = certutils.CertStore.from_store(os.path.join(d, "ca1"), "test") ca2 = certutils.CertStore.from_store(os.path.join(d, "ca2"), "test") cert = ca1.get_cert("foo.com", []) assert certffi.get_flags(ca2.gen_pkey(cert[0])) == 1 finally: certffi.set_flags(ca2.default_privatekey, 0)