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

SAMLBuilder: use SimpleSAML_Utilities::loadPublicKey

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@928 44740490-163a-0410-bde0-09ae8108e29a
parent bfee6397
No related branches found
No related tags found
No related merge requests found
......@@ -360,21 +360,13 @@ class SimpleSAML_Metadata_SAMLBuilder {
private function addCertificate(DOMElement $ssoDesc, $metadata) {
assert('is_array($metadata)');
if (!array_key_exists('certificate', $metadata)) {
$certInfo = SimpleSAML_Utilities::loadPublicKey($metadata);
if ($certInfo === NULL || !array_key_exists('certData', $certInfo)) {
/* No certificate to add. */
return;
}
$globalConfig = SimpleSAML_Configuration::getInstance();
$certFile = $globalConfig->getPathValue('certdir') . $metadata['certificate'];
if (!file_exists($certFile)) {
throw new Exception('Could not find certificate file: ' . $certFile);
}
$certData = file_get_contents($certFile);
$certData = XMLSecurityDSig::get509XCert($certData, TRUE);
$certData = $certInfo['certData'];
$keyDescriptor = $this->createElement('KeyDescriptor');
$ssoDesc->appendChild($keyDescriptor);
......
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