def show_ca_detail(self): self.show_ca() if SSL.check_ca_exist(): print "##################################################" print "### Detail" SSL.display_cert(SSL.get_ca()) else: print "Cannot get details. CA not created yet"
def show_cert(self, certid=None): list = [] if certid: rawmode = False if "_" in certid and certid.split("_")[1] == "raw": rawmode = True certid = certid.split("_")[0] i=0 for cert in SSL.get_all_certificates(): if certid == cert['id']: i = 1 SSL.display_cert(cert['cert']) if rawmode: print crypto.dump_certificate(crypto.FILETYPE_PEM, cert['cert']) if i == 0: print "*** Certificate not found" else: for cert in SSL.get_all_certificates(): state = SSL.get_state_cert(cert['cert']) list.append((cert['id'], SSL.get_x509_name(cert['cert'].get_subject()), state)) Render.print_table(('ID', 'Subject', 'State'), list)