How to change the gpg key associated with your pass / password store Link to heading
Today I wanted to change the gpg key that is used for encrypting and decrypting my passwords in Unix’s password store.
A quick look at the man page for pass taught me that all I have to do is:
pass init "new-GPG-key-id"
From the man page (first part):
init [ --path=sub-folder, -p sub-folder ] gpg-id...
Initialize new password storage and use gpg-id for encryption. Multiple gpg-ids may be specified, in order to encrypt each password with multiple ids. This command must be run first before a password store can be used.
And then it continues:
If the specified gpg-id is different from the key used in any existing files, these files will be reencrypted to use the new id.
And so on.
So, there you have it. Just re-initaliase the password store with your new key ID(s), and you’re good to go.
If you are rusty with GPG, your can find your gpg key ID by entering the following command:
gpg --list-keys
I hope this helps!