def display_profile(self, profile): keys = str(Config().config.get("profile_" + profile, "keyusage")).split("|") print "\tKey Usage" for (k, v) in SSL.get_key_usage().iteritems(): if k in keys: print "\t\t%s" % v keys = str(Config().config.get("profile_" + profile, "extended")).split("|") print "\tExtended Key Usage" for (k, v) in SSL.get_extended_key_usage().iteritems(): if k in keys: print "\t\t%s" % v
def do_profile(self, line): if line: profile = line.split(' ')[0] else: profile = raw_input("Profile name : ") keys_usage = [] extended_keys = [] if Config().config.has_section("profile_" + profile): keys_usage = str(Config().config.get("profile_" + profile, "keyusage")).split('|') extended_keys = str(Config().config.get("profile_" + profile, "extended")).split('|') else: Config().config.add_section("profile_"+profile) keys_usage = Render.print_selector(SSL.get_key_usage(), keys_usage) extended_keys = Render.print_selector(SSL.get_extended_key_usage(), extended_keys) Config().config.set("profile_" + profile, "keyusage", '|'.join(keys_usage)) Config().config.set("profile_" + profile, "extended", '|'.join(extended_keys)) rep = raw_input("Use LDAP if enable to search subject (y/n) : ") if "y" in rep: filter = raw_input("LDAP Filter : ") Config().config.set("profile_" + profile, "ldap", filter) else: Config().config.set("profile_" + profile, "ldap", "false")