SimpleSAML_Metadata_MetaDataStorageHandler::getMetaDataConfigForSha1 PHP Method

getMetaDataConfigForSha1() public method

Search for an entity's metadata, given the SHA1 digest of its entity ID.
public getMetaDataConfigForSha1 ( string $sha1, string $set ) : null | SimpleSAML_Configuration
$sha1 string The SHA1 digest of the entity ID.
$set string The metadata set we are searching.
return null | SimpleSAML_Configuration The metadata corresponding to the entity, or null if the entity cannot be found.
    public function getMetaDataConfigForSha1($sha1, $set)
    {
        assert('is_string($sha1)');
        assert('is_string($set)');
        $result = array();
        foreach ($this->sources as $source) {
            $srcList = $source->getMetadataSet($set);
            /* $result is the last argument to array_merge because we want the content already
             * in $result to have precedence.
             */
            $result = array_merge($srcList, $result);
        }
        foreach ($result as $remote_provider) {
            if (sha1($remote_provider['entityid']) == $sha1) {
                $remote_provider['metadata-set'] = $set;
                return SimpleSAML_Configuration::loadFromArray($remote_provider, $set . '/' . var_export($remote_provider['entityid'], true));
            }
        }
        return null;
    }