Skip to content
Snippets Groups Projects
Commit d4fe2dbf authored by Olav Morken's avatar Olav Morken
Browse files

SAMLParser: Add support for multiple certificates.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2515 44740490-163a-0410-bde0-09ae8108e29a
parent 43f60f73
No related branches found
No related tags found
No related merge requests found
......@@ -586,11 +586,19 @@ class SimpleSAML_Metadata_SAMLBuilder {
*/
private function addCertificate(SAML2_XML_md_RoleDescriptor $rd, SimpleSAML_Configuration $metadata) {
$certInfo = SimpleSAML_Utilities::loadPublicKey($metadata);
if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) {
$certData = $certInfo['certData'];
$this->addX509KeyDescriptor($rd, 'signing', $certData);
$this->addX509KeyDescriptor($rd, 'encryption', $certData);
$keys = $metadata->getPublicKeys();
if ($keys !== NULL) {
foreach ($keys as $key) {
if ($key['type'] !== 'X509Certificate') {
continue;
}
if (!isset($key['signing']) || $key['signing'] === TRUE) {
$this->addX509KeyDescriptor($rd, 'signing', $key['X509Certificate']);
}
if (!isset($key['encryption']) || $key['encryption'] === TRUE) {
$this->addX509KeyDescriptor($rd, 'encryption', $key['X509Certificate']);
}
}
}
if ($metadata->hasValue('https.certData')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment