public function decryptAttributes(XMLSecurityKey $key, array $blacklist = []) : void
    {
        if (!$this->hasEncryptedAttributes()) {
            return;
        }
        $firstAttribute = true;
        $attributes = $this->getEncryptedAttributes();
        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] = [];
            }

            $this->parseAttributeValue($attribute, $name);
        }
    }
public function decryptAttributes(XMLSecurityKey $key, array $blacklist = []) : void
    {
        if (!$this->hasEncryptedAttributes()) {
            return;
        }
        $firstAttribute = true;
        $attributes = $this->getEncryptedAttributes();
        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] = [];
            }

            $this->parseAttributeValue($attribute, $name);
        }
    }
public function decryptAttributes ( XMLSecurityKey $ key , array $ blacklist = [ ] ) : void { if ( ! $ this -> hasEncryptedAttributes ( ) ) { return ; } $ firstAttribute = true ; $ attributes = $ this -> getEncryptedAttributes ( ) ; 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 ] = [ ] ; } $ this -> parseAttributeValue ( $ attribute , $ name ) ; } }
Decrypt the assertion attributes.

@param XMLSecurityKey $key
@param array $blacklist
@throws \Exception
@return void
Decrypt the assertion attributes .