@@ -20,42 +20,37 @@ public function mapTo(array $rootElement)
2020 if (empty ($ publicCertificate )) {
2121 return $ rootElement ;
2222 }
23- $ rootElement ['md:KeyDescriptor ' ] = array (
24- array (
25- EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'xmlns:ds ' => 'http://www.w3.org/2000/09/xmldsig# ' ,
26- EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'use ' => 'signing ' ,
27- 'ds:KeyInfo ' => array (
28- 'ds:X509Data ' => array (
29- 'ds:X509Certificate ' => array (
30- EngineBlock_Corto_XmlToArray::VALUE_PFX => $ this ->_mapPem ($ publicCertificate ),
31- ),
32- ),
33- ),
34- ),
35- /**
36- * https://jira.surfconext.nl/jira/browse/BACKLOG-874
37- *
38- * Encryption key is no longer provided to prevent the idp returning an encrypted response
3923
40- array(
41- EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#',
42- EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'use' => 'encryption',
43- 'ds:KeyInfo' => array(
44- 'ds:X509Data' => array(
45- 'ds:X509Certificate' => array(
46- EngineBlock_Corto_XmlToArray::VALUE_PFX => $this->_mapPem($publicCertificate),
47- ),
48- ),
49- ),
50- 'md:EncryptionMethod' => array(
51- array(
52- EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'Algorithm' => 'http://www.w3.org/2001/04/xmlenc#rsa-1_5',
24+ $ rootElement ['md:KeyDescriptor ' ] = array ($ this ->getSigningKeyMetadataForCert ($ publicCertificate ));
25+
26+ if (isset ($ this ->_entity ['certificates ' ]['public-fallback ' ])) {
27+ $ rootElement ['md:KeyDescriptor ' ][] = $ this ->getSigningKeyMetadataForCert (
28+ $ this ->_entity ['certificates ' ]['public-fallback ' ]
29+ );
30+ }
31+
32+ if (isset ($ this ->_entity ['certificates ' ]['public-fallback2 ' ])) {
33+ $ rootElement ['md:KeyDescriptor ' ][] = $ this ->getSigningKeyMetadataForCert (
34+ $ this ->_entity ['certificates ' ]['public-fallback2 ' ]
35+ );
36+ }
37+
38+ return $ rootElement ;
39+ }
40+
41+ protected function getSigningKeyMetadataForCert ($ publicCertificate )
42+ {
43+ return array (
44+ EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'xmlns:ds ' => 'http://www.w3.org/2000/09/xmldsig# ' ,
45+ EngineBlock_Corto_XmlToArray::ATTRIBUTE_PFX . 'use ' => 'signing ' ,
46+ 'ds:KeyInfo ' => array (
47+ 'ds:X509Data ' => array (
48+ 'ds:X509Certificate ' => array (
49+ EngineBlock_Corto_XmlToArray::VALUE_PFX => $ this ->_mapPem ($ publicCertificate ),
5350 ),
5451 ),
5552 ),
56- */
5753 );
58- return $ rootElement ;
5954 }
6055
6156 protected function _mapPem ($ pemKey )
0 commit comments