def make_federation_entity(config, eid='<STR_LIT>', httpcli=None, verify_ssl=True):
args = {}<EOL>if not eid:<EOL><INDENT>try:<EOL><INDENT>eid = config['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if '<STR_LIT>' in config:<EOL><INDENT>self_signer = make_internal_signing_service(config['<STR_LIT>'],<EOL>eid)<EOL>args['<STR_LIT>'] = self_signer<EOL><DEDENT>try:<EOL><INDENT>bundle_cnf = config['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>_args = dict([(k, v) for k, v in bundle_cnf.items() if k in KJ_SPECS])<EOL>if _args:<EOL><INDENT>_kj = init_key_jar(**_args)<EOL><DEDENT>else:<EOL><INDENT>_kj = None<EOL><DEDENT>if '<STR_LIT>' in bundle_cnf:<EOL><INDENT>jb = FSJWKSBundle(eid, _kj, bundle_cnf['<STR_LIT>'],<EOL>key_conv={'<STR_LIT:to>': quote_plus, '<STR_LIT>': unquote_plus})<EOL><DEDENT>else:<EOL><INDENT>jb = JWKSBundle(eid, _kj)<EOL><DEDENT>args['<STR_LIT>'] = jb<EOL><DEDENT>for item in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>try:<EOL><INDENT>args[item] = config[item]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if '<STR_LIT>' not in args:<EOL><INDENT>args['<STR_LIT>'] = eid<EOL><DEDENT>if '<STR_LIT>' in config:<EOL><INDENT>args['<STR_LIT>'] = config['<STR_LIT>']<EOL>return FederationEntityOOB(httpcli, iss=eid, **args)<EOL><DEDENT>elif '<STR_LIT>' in config:<EOL><INDENT>args['<STR_LIT>'] = verify_ssl<EOL>args['<STR_LIT>'] = config['<STR_LIT>']<EOL>return FederationEntityAMS(httpcli, iss=eid, **args)<EOL><DEDENT>elif '<STR_LIT>' in config:<EOL><INDENT>args['<STR_LIT>'] = verify_ssl<EOL>for key in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>args[key] = config[key]<EOL><DEDENT>return FederationEntitySwamid(httpcli, iss=eid, **args)<EOL><DEDENT>
Construct a :py:class:`fedoidcmsg.entity.FederationEntity` instance based
on given configuration.

:param config: Federation entity configuration
:param eid: Entity ID
:param httpcli: A http client instance to use when sending HTTP requests
:param verify_ssl: Whether TLS/SSL certificates should be verified
:return: A :py:class:`fedoidcmsg.entity.FederationEntity` instance