gpg – GPG Problem in Using Pass Password Manager

gpgpassword-store

I would like to use the "pass" password manager. I don't seem to be able
to get pass to recognize my public key.

$ gpg2 --list-keys

/home/johndoe/.gnupg/pubring.gpg
-------------------------------

pub   rsa4096/3AD31D0B 2011-02-08 [SCE]
uid         [ unknown] Fedora-SPARC (15) <fedora@fedoraproject.org>
sub   elg4096/A9DAE699 2011-02-08 [E]

… lots of other keys like the one above and then …

pub   rsa2048/27FA9292 2016-03-31 [SC]
uid         [ultimate] John Doe <johndoe@gmail.com>
sub   rsa2048/7C8FD1D9 2016-03-31 [E]

$ pass git init 27FA9292
Reinitialized existing Git repository in /home/johndoe/.password-store/.git/

pass insert pubs/checkbook
Enter password for pubs/checkbook: 
Retype password for pubs/checkbook: 
gpg: captain Password Storage Key: skipped: No public key
gpg: [stdin]: encryption failed: No public key
fatal: pathspec '/home/johndoe/.password-store/pubs/checkbook.gpg' did not match any files

captain is the hostname. Why can pass not find my public key?

Thank you.

Best Answer

You can't compress the two commands into one. You need to first initialise the pass store with your key and then, separately, initialise the git repository. Because, as the manual states, pass git only takes git-command-args.

So, the correct approach requires two steps:

pass init YOUR_KEY
pass git init
Related Question