code: def pre_encrypt_assertion(response):
      
      assertion = response.assertion
      response.assertion = None
      response.encrypted_assertion = EncryptedAssertion()
      if assertion is not None:
          if isinstance(assertion, list):
              response.encrypted_assertion.add_extension_elements(assertion)
          else:
              response.encrypted_assertion.add_extension_element(assertion)
      return response
docs: Move the assertion to within a encrypted_assertion
      :param response: The response with one assertion
      :return: The response but now with the assertion within an
          encrypted_assertion.