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 
7 if (!$config->getBoolean('enable.saml20-idp', false))
8  throw new SimpleSAML_Error_Error('NOACCESS');
9 
10 // Check if valid local session exists..
11 if ($config->getBoolean('admin.protectmetadata', false)) {
13 }
14 
15 $idpentityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
16 $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted');
17 
18 switch($_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 
32 header('Content-Disposition: attachment; filename='.substr($_SERVER['PATH_INFO'], 1));
33 header('Content-Type: application/x-x509-ca-cert');
34 echo $certInfo['PEM'];
35 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('admin.protectmetadata', false)) $idpentityid
Definition: certs.php:15
$idpmeta
Definition: certs.php:16
static loadPublicKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='')
Get public key or certificate from metadata.
Definition: Crypto.php:265
Add a drawing to the header
Definition: 04printing.php:69
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.