Example #1
0
 def test_cloud_search_by_thumbprint(self):
     req, cert = simple_enroll(self.cloud_conn, self.cloud_zone)
     cert = x509.load_pem_x509_certificate(cert.cert.encode(), default_backend())
     fingerprint = binascii.hexlify(cert.fingerprint(hashes.SHA1())).decode()
     time.sleep(1)
     found = self.cloud_conn.search_by_thumbprint(fingerprint)
     self.assertEqual(found.certificateIds[0], req.cert_guid)
Example #2
0
 def test_revoke_normal(self):
     req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
     rev_req = RevocationRequest(req_id=req.id)
     self.tpp_conn.revoke_cert(rev_req)
     time.sleep(1)
     with self.assertRaises(Exception):
         self.tpp_conn.renew_cert(req)
Example #3
0
 def test_tpp_search_by_thumbpint(self):
     req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
     cert = x509.load_pem_x509_certificate(cert.cert.encode(),
                                           default_backend())
     fingerprint = binascii.hexlify(cert.fingerprint(
         hashes.SHA1())).decode()
     found = self.tpp_conn.search_by_thumbprint(fingerprint)
     self.assertEqual(found, req.id)
Example #4
0
 def test_revoke_normal_thumbprint(self):
     req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
     cert = x509.load_pem_x509_certificate(cert.cert.encode(),
                                           default_backend())
     thumbprint = binascii.hexlify(cert.fingerprint(hashes.SHA1())).decode()
     rev_req = RevocationRequest(thumbprint=thumbprint)
     self.tpp_conn.revoke_cert(rev_req)
     time.sleep(1)
     with self.assertRaises(Exception):
         self.tpp_conn.renew_cert(req)
Example #5
0
 def test_revoke_without_disable(self):
     req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
     rev_req = RevocationRequest(req_id=req.id, disable=False)
     self.tpp_conn.revoke_cert(rev_req)
     time.sleep(1)
     self.tpp_conn.renew_cert(req)