ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ServiceProvider.php
Go to the documentation of this file.
1 <?php
2 
3 namespace SAML2\Configuration;
4 
6 
10 class 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 
33  public function getCertificateFingerprints()
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 }
getKeys()
Returns an array or of keys, where each element represents a configured key.
Basic Configuration Wrapper.
CertificateProvider interface.
getCertificateData()
Returns the contents of an X509 pem certificate, without the &#39;--—BEGIN CERTIFICATE--—&#39; and &#39;--—END...
getCertificateFile()
Returns the full path to the (local) file that contains the X509 pem certificate. ...
if($format !==null) $name
Definition: metadata.php:146
getPrivateKey($name, $required=false)
Configuration of a private key.
Definition: PrivateKey.php:10
Create styles array
The data for the language used.
Default implementation for configuration.
Definition: ArrayAdapter.php:8
$key
Definition: croninfo.php:18