예제 #1
0
    def __init__(self, cargs, kwargs):
        self.nspair = {"xs": "http://www.w3.org/2001/XMLSchema"}

        _cnf = kwargs['conf']
        res = read_multi_conf(_cnf, True)
        eds = []
        for key, cnf in res.items():
            eds.append(entity_descriptor(cnf))

        valid_for = 0

        """
            Setting things to None here that are now unused, but might be useful someday
        """
        conf = Config()
        conf.key_file = None
        conf.cert_file = None
        conf.debug = 1
        conf.xmlsec_binary = None
        args_name = None
        args_id = None
        args_sign = None
        secc = security_context(conf)

        desc, xmldoc = entities_descriptor(eds, valid_for, args_name, args_id,
                                           args_sign, secc)
        valid_instance(desc)

        self.desc = desc
        self.xmldoc = xmldoc
예제 #2
0
parser.add_argument('-p', dest='path',
                    help="path to the configuration file")
parser.add_argument('-s', dest='sign', action='store_true',
                    help="sign the metadata")
parser.add_argument('-x', dest='xmlsec',
                    help="xmlsec binaries to be used for the signing")
parser.add_argument('-o', dest='outputfile',
                    help="write into output file instead of stdout")
parser.add_argument(dest="config")
args = parser.parse_args()

sys.path.insert(0, '.')

_cnf = importlib.import_module(args.config)

res = read_multi_conf(_cnf, True)
eds = []
for key, cnf in res.items():
    eds.append(entity_descriptor(cnf))

if args.valid:
    valid_for = int(args.valid) * 24
else:
    valid_for = 0

nspair = {"xs": "http://www.w3.org/2001/XMLSchema"}

conf = Config()
conf.key_file = args.keyfile
conf.cert_file = args.cert
conf.debug = 1