public function decryptAttributes(XMLSecurityKey $key, array $blacklist = array())
{
if ($this->encryptedAttributes === null) {
return;
}
$firstAttribute = true;
$attributes = $this->encryptedAttributes;
foreach ($attributes as $attributeEnc) {
/*Decrypt node <EncryptedAttribute>*/
$attribute = Utils::decryptElement($attributeEnc->getElementsByTagName('EncryptedData')->item(0), $key, $blacklist);
if (!$attribute->hasAttribute('Name')) {
throw new \Exception('Missing name on <saml:Attribute> element.');
}
$name = $attribute->getAttribute('Name');
if ($attribute->hasAttribute('NameFormat')) {
$nameFormat = $attribute->getAttribute('NameFormat');
} else {
$nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
}
if ($firstAttribute) {
$this->nameFormat = $nameFormat;
$firstAttribute = false;
} else {
if ($this->nameFormat !== $nameFormat) {
$this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
}
}
if (!array_key_exists($name, $this->attributes)) {
$this->attributes[$name] = array();
}
$this->parseAttributeValue($attribute, $name);
}
}