Correctly handle private and public key filenames