本文整理汇总了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;
}