Whose final signature goes on the treaty?

Does the Queen need to ratify it? And if she turns around and goes 'One believes that the people were promised a referendum'... what happens next?