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