ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ServiceProvider.php
Go to the documentation of this file.
1<?php
2
3namespace SAML2\Configuration;
4
6
10class ServiceProvider extends ArrayAdapter implements
14{
15 public function getKeys()
16 {
17 return $this->get('keys');
18 }
19
20 public function getCertificateData()
21 {
22 return $this->get('certificateData');
23 }
24
25 public function getCertificateFile()
26 {
27 return $this->get('certificateFile');
28 }
29
34 {
35 return $this->get('certificateFingerprints');
36 }
37
38 public function getEntityId()
39 {
40 return $this->get('entityId');
41 }
42
44 {
45 return $this->get('assertionEncryptionEnabled');
46 }
47
48 public function getSharedKey()
49 {
50 return $this->get('sharedKey');
51 }
52
53 public function getPrivateKey($name, $required = false)
54 {
55 $privateKeys = $this->get('privateKeys');
56 $key = array_filter($privateKeys, function (PrivateKey $key) use ($name) {
57 return $key->getName() === $name;
58 });
59
60 $keyCount = count($key);
61 if ($keyCount !== 1 && $required) {
62 throw new \RuntimeException(sprintf(
63 'Attempted to get privateKey by name "%s", found "%d" keys, where only one was expected. Please '
64 . 'verify that your configuration is correct',
65 $name,
66 $keyCount
67 ));
68 }
69
70 if (!$keyCount) {
71 return null;
72 }
73
74 return array_pop($key);
75 }
76
77 public function getBlacklistedAlgorithms()
78 {
79 return $this->get('blacklistedEncryptionAlgorithms', array(XMLSecurityKey::RSA_1_5));
80 }
81}
An exception for terminatinating execution or to throw for unit testing.
Default implementation for configuration.
Definition: ArrayAdapter.php:9
Configuration of a private key.
Definition: PrivateKey.php:11
Basic Configuration Wrapper.
getCertificateData()
Returns the contents of an X509 pem certificate, without the '--—BEGIN CERTIFICATE--—' and '--—END CE...
getKeys()
Returns an array or \Traversable of keys, where each element represents a configured key.
getPrivateKey($name, $required=false)
getCertificateFile()
Returns the full path to the (local) file that contains the X509 pem certificate.
$key
Definition: croninfo.php:18
Interface \SAML2\Configuration\EntityIdProvider.