当前位置: 首页>>代码示例>>Python>>正文


Python md.entity_descriptor_from_string函数代码示例

本文整理汇总了Python中saml2.md.entity_descriptor_from_string函数的典型用法代码示例。如果您正苦于以下问题:Python entity_descriptor_from_string函数的具体用法?Python entity_descriptor_from_string怎么用?Python entity_descriptor_from_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了entity_descriptor_from_string函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse

    def parse(self, xmlstr):
        self.entities_descr = md.entities_descriptor_from_string(xmlstr)

        if not self.entities_descr:
            self.entity_descr = md.entity_descriptor_from_string(xmlstr)
            if self.entity_descr:
                self.do_entity_descriptor(self.entity_descr)
        else:
            try:
                valid_instance(self.entities_descr)
            except NotValid, exc:
                logger.error(exc.args[0])
                return

            if self.check_validity:
                try:
                    if not valid(self.entities_descr.valid_until):
                        raise ToOld(
                            "Metadata not valid anymore, it's after %s" % (
                                self.entities_descr.valid_until,))
                except AttributeError:
                    pass

            for entity_descr in self.entities_descr.entity_descriptor:
                self.do_entity_descriptor(entity_descr)
开发者ID:jakew1ll,项目名称:pysaml2,代码行数:25,代码来源:mdstore.py

示例2: import_metadata

 def import_metadata(self, xml_str, source):
     """ Import information; organization distinguish name, location and
     certificates from a metadata file.
     
     :param xml_str: The metadata as a XML string.
     :param source: A name by which this source should be known, has to be
         unique within this session.
     """
     
     # now = time.gmtime()
     #print >> sys.stderr, "Loading %s" % (source,)
     
     entities_descr = md.entities_descriptor_from_string(xml_str)
     if not entities_descr:
         entity_descr = md.entity_descriptor_from_string(xml_str)
         if entity_descr:
             self.do_entity_descriptor(entity_descr, source)
     else:
         try:
             valid_instance(entities_descr)
         except NotValid, exc:
             print >> sys.stderr, exc.args[0]
             return
     
         try:
             valid(entities_descr.valid_until)
         except AttributeError:
             pass
     
         for entity_descr in entities_descr.entity_descriptor:
             self.do_entity_descriptor(entity_descr, source, 
                                         entities_descr.valid_until)
开发者ID:FluidReview,项目名称:saml2,代码行数:32,代码来源:metadata.py

示例3: sign_entity_descriptor

def sign_entity_descriptor(edesc, ident, secc):
    if not ident:
        ident = sid()

    edesc.signature = pre_signature_part(ident, secc.my_cert, 1)
    edesc.id = ident
    xmldoc = secc.sign_statement_using_xmlsec("%s" % edesc, class_name(edesc))
    return md.entity_descriptor_from_string(xmldoc)
开发者ID:GSA,项目名称:pysaml2,代码行数:8,代码来源:metadata.py

示例4: sign_entity_descriptor

def sign_entity_descriptor(edesc, valid_for, ident, secc):
    if valid_for:
        edesc.valid_until = in_a_while(hours=valid_for)

    if not ident:
        ident = sid()

    edesc.signature = pre_signature_part(ident, secc.my_cert, 1)
    edesc.id = ident
    xmldoc = secc.sign_statement_using_xmlsec("%s" % edesc, class_name(edesc))
    return md.entity_descriptor_from_string(xmldoc)
开发者ID:FluidReview,项目名称:saml2,代码行数:11,代码来源:metadata.py

示例5: sign_entity_descriptor

def sign_entity_descriptor(edesc, ident, secc):
    """

    :param edesc: EntityDescriptor instance
    :param ident: EntityDescriptor identifier
    :param secc: Security context
    :return: Tuple with EntityDescriptor instance and Signed XML document
    """

    if not ident:
        ident = sid()

    edesc.signature = pre_signature_part(ident, secc.my_cert, 1)
    edesc.id = ident
    xmldoc = secc.sign_statement("%s" % edesc, class_name(edesc))
    edesc = md.entity_descriptor_from_string(xmldoc)
    return edesc, xmldoc
开发者ID:5monkeys,项目名称:pysaml2,代码行数:17,代码来源:metadata.py

示例6: parse

    def parse(self, xmlstr):
        self.entities_descr = md.entities_descriptor_from_string(xmlstr)

        if not self.entities_descr:
            self.entity_descr = md.entity_descriptor_from_string(xmlstr)
            if self.entity_descr:
                self.do_entity_descriptor(self.entity_descr)
        else:
            try:
                valid_instance(self.entities_descr)
            except NotValid, exc:
                logger.error(exc.args[0])
                return

            try:
                valid(self.entities_descr.valid_until)
            except AttributeError:
                pass

            for entity_descr in self.entities_descr.entity_descriptor:
                self.do_entity_descriptor(entity_descr)
开发者ID:hufman,项目名称:pysaml2,代码行数:21,代码来源:mdstore.py


注:本文中的saml2.md.entity_descriptor_from_string函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。