SimpleSAML_Metadata_Signer::isMetadataSigningEnabled PHP Method

isMetadataSigningEnabled() private static method

Determine whether metadata signing is enabled for the given metadata.
private static isMetadataSigningEnabled ( SimpleSAML_Configuration $config, array $entityMetadata, string $type ) : boolean
$config SimpleSAML_Configuration Our SimpleSAML_Configuration instance.
$entityMetadata array The metadata of the entity.
$type string A string which describes the type entity this is, e.g. 'SAML 2 IdP' or 'Shib 1.3 SP'.
return boolean True if metadata signing is enabled, false otherwise.
    private static function isMetadataSigningEnabled($config, $entityMetadata, $type)
    {
        // first check the metadata for the entity
        if (array_key_exists('metadata.sign.enable', $entityMetadata)) {
            if (!is_bool($entityMetadata['metadata.sign.enable'])) {
                throw new Exception('Invalid value for the "metadata.sign.enable" configuration option for' . ' the ' . $type . ' "' . $entityMetadata['entityid'] . '". This option' . ' should be a boolean.');
            }
            return $entityMetadata['metadata.sign.enable'];
        }
        $enabled = $config->getBoolean('metadata.sign.enable', false);
        return $enabled;
    }