コード例 #1
0
ファイル: test_tcp.py プロジェクト: clonger89/netlib
 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)
コード例 #2
0
 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)
コード例 #3
0
ファイル: test_certutils.py プロジェクト: BennyH26/netlib
 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)
コード例 #4
0
 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)