Refactor the signing repository code so that the key is being asked only
once