# File lib/openid/server.rb, line 751
      def encode(response)
        if (not response.kind_of?(Exception)) and response.needs_signing?
          if response.fields.has_key?('sig')
            raise AlreadySigned
          end
          response = @signatory.sign(response)
        end
        return super(response)
      end