ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
certs.php
Go to the documentation of this file.
1<?php
2
3// Load SimpleSAMLphp, configuration and metadata
6
7if (!$config->getBoolean('enable.saml20-idp', false))
8 throw new SimpleSAML_Error_Error('NOACCESS');
9
10// Check if valid local session exists..
11if ($config->getBoolean('admin.protectmetadata', false)) {
13}
14
15$idpentityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
16$idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted');
17
18switch($_SERVER['PATH_INFO']) {
19 case '/new_idp.crt':
21 break;
22 case '/idp.crt':
24 break;
25 case '/https.crt':
27 break;
28 default:
29 throw new SimpleSAML_Error_NotFound('Unknown certificate.');
30}
31
32header('Content-Disposition: attachment; filename='.substr($_SERVER['PATH_INFO'], 1));
33header('Content-Type: application/x-x509-ca-cert');
34echo $certInfo['PEM'];
35exit(0);
if($config->getBoolean('admin.protectmetadata', false)) $idpentityid
Definition: certs.php:15
$config
Definition: certs.php:4
$idpmeta
Definition: certs.php:16
$metadata
Definition: certs.php:5
An exception for terminatinating execution or to throw for unit testing.
static requireAdmin()
Require admin access to the current page.
Definition: Auth.php:60
static loadPublicKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='')
Get public key or certificate from metadata.
Definition: Crypto.php:265
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static getMetadataHandler()
This function retrieves the current instance of the metadata handler.
$certInfo
Definition: metadata.php:25
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']