The public key is used as a first level of defense by the bootstrapper: if the public key of the downloaded package does not match what the bootstrapper was built with, the installation will fail out of the box.
More checks are then done by the bootstrapper; I'm not going to go into many details, but it is similar to what is done in the Windows Installer Guide around bootstrapping. See in particular "Internet Download Bootstrapping" on MSDN (http://msdn2.microsoft.com/en-us/library/aa369557.aspx)