Improved re-signing script.
Now checks the identity and certificate used to sign, and doesn't bother doing it again if they match.