I'm looking into how jarsigner works and the purpose of each file in the META-INF folder. As I understand, MANIFEST.MF contains a listing of every file in the zip/jar along with a digest of it. The *.SF file contains a digest of the manifest file, and a listing of every file along with a digest of the section of that file in the manifest. Finally, the *.DSA/RSA file contains a digital signature of the .SF file. My question is, why is there a need for a SF file? What advantage does it have over simply signing the manifest file and storing that in the .RSA/DSA file?
Any change to a file name or content or file deletion would cause a change to the manifest and hence an invalid signature.