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


PHP SimpleSAML_Utilities::cert_fingerprint方法代码示例

本文整理汇总了PHP中SimpleSAML_Utilities::cert_fingerprint方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Utilities::cert_fingerprint方法的具体用法?PHP SimpleSAML_Utilities::cert_fingerprint怎么用?PHP SimpleSAML_Utilities::cert_fingerprint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleSAML_Utilities的用法示例。


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

示例1: getmetadata_shib13idpremote

 private function getmetadata_shib13idpremote($metadataxml)
 {
     // Create a parser for the metadata document.
     $metadata_parser = new SimpleSAML_XML_Parser($metadataxml);
     // Get all entries in the metadata.
     $idpentities = $metadata_parser->simplexml->xpath('/saml2meta:EntitiesDescriptor/saml2meta:EntityDescriptor[./saml2meta:IDPSSODescriptor]');
     if (!$idpentities) {
         throw new Exception('Could not find any entity descriptors in the meta data file: ' . $metadatasetfile);
     }
     // Array to hold the resulting metadata, to return at the end of this function.
     $metadata = array();
     // Traverse all entries.
     foreach ($idpentities as $idpentity) {
         try {
             $entityid = (string) $idpentity['entityID'];
             if (!$entityid) {
                 throw new Exception('Could not find entityID in element');
             }
             $metadata[$entityid] = array('entityid' => $entityid);
             $metadata_entry = SimpleSAML_XML_Parser::fromSimpleXMLElement($idpentity);
             $metadata[$entityid]['SingleSignOnService'] = $metadata_entry->getValue("/saml2meta:EntityDescriptor/saml2meta:IDPSSODescriptor/saml2meta:SingleSignOnService[@Binding='urn:mace:shibboleth:1.0:profiles:AuthnRequest']/@Location", true);
             $metadata[$entityid]['certFingerprint'] = SimpleSAML_Utilities::cert_fingerprint($metadata_entry->getValue("/saml2meta:EntityDescriptor/saml2meta:IDPSSODescriptor/saml2meta:KeyDescriptor[@use='signing']/ds:KeyInfo/ds:X509Data/ds:X509Certificate", true));
             $seek_base64 = $metadata_entry->getValue("/saml2meta:EntityDescriptor/saml2meta:IDPSSODescriptor/saml2meta:Extensions/saml2:Attribute[@Name='urn:mace:feide.no:simplesamlphp:base64attributes']/saml2:AttributeValue");
             $metadata[$entityid]['base64attributes'] = isset($seek_base64) ? $seek_base64 === 'true' : false;
             $metadata[$entityid]['name'] = $metadata_entry->getValueAlternatives(array("/saml2meta:EntityDescriptor/saml2meta:IDPSSODescriptor/saml2meta:Extensions/saml2:Attribute[@Name='urn:mace:feide.no:simplesamlphp:name']/saml2:AttributeValue", "/saml2meta:EntityDescriptor/saml2meta:IDPSSODescriptor/saml2meta:Organization/saml2meta:OrganizationDisplayName"));
             $metadata[$entityid]['description'] = $metadata_entry->getValue("/saml2meta:EntityDescriptor/saml2meta:IDPSSODescriptor/saml2meta:Extensions/saml2:Attribute[@Name='urn:mace:feide.no:simplesamlphp:description']/saml2:AttributeValue");
         } catch (Exception $e) {
             SimpleSAML_Logger::info('MetaData - Handler.SAML2Meta: Error parsing [' . __FUNCTION__ . '] ' . $e->getMessage());
         }
     }
     return $metadata;
 }
开发者ID:hukumonline,项目名称:yii,代码行数:32,代码来源:MetaDataStorageHandlerSAML2Meta.php


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