If you created a GPG key on your computer using a GPG version higher than 2.2.0, OpenKeychain will likely throw an error when trying to read it:
Error from OpenKeyChain: Encountered an error reading input data!
I recently encountered this error when updating my keys for my password store. To get around the error, you can temporarily install an older version of GPG, re-initialize your password store, and re-export your keys to your Android device.
Install GnuPG version 2.2:
brew install gnupg@2.2Specify that you want to use this specific GPG version for your current terminal session:
echo 'export PATH="/opt/homebrew/opt/gnupg@2.2/bin:$PATH"' >> /Users/johnnymatthews/.bash_profile && source ~/.bash_profileReplace
johnnymatthewswith your username.Re-initialise your password store:
pass init johnnyReplace
johnnywith the identifier of your key.Push any changes to your remote pass store:
pass git pushRe-export your key:
gpg --export-secret-keys johnny > private.keyAgain, replace
johnnywith the identifier of your key.Securely copy
private.keyto your Android device.Delete your old key from the OpenKeychain app and import the
private.keyfile.Pull your password store changes from Git.
You should now be able to view your passwords with your GPG key! At this point, you can remove the old version of GPG from your system with:
brew remove gnupg@2.2
rm -rf /opt/homebrew/etc/gnupg