'Decrypts possible encrypted attributes and adds the decrypts to the
list of attributes.
:param attribute_statement: A SAML.AttributeStatement which might
contain both encrypted attributes and attributes.'

def decrypt_attributes(self, attribute_statement):

    for encattr in attribute_statement.encrypted_attribute:
        if (not encattr.encrypted_key):
            _decr = self.sec.decrypt(encattr.encrypted_data)
            _attr = attribute_from_string(_decr)
            attribute_statement.attribute.append(_attr)
        else:
            _decr = self.sec.decrypt(encattr)
            enc_attr = encrypted_attribute_from_string(_decr)
            attrlist = enc_attr.extensions_as_elements('Attribute', saml)
            attribute_statement.attribute.extend(attrlist)
