當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。