Skip to content

Latest commit

 

History

History
82 lines (70 loc) · 2.06 KB

gpg.md

File metadata and controls

82 lines (70 loc) · 2.06 KB

Create your key using the 25519 curve — it's cool, and it's short:

gpg --expert --full-gen-key

Enter the following at each of the prompts:

  9 # ECC and ECC
  1 # 25519
  40y # 40 years

Integrate gpg with GitHub: https://help.github.com/articles/signing-commits-with-gpg/

List your keys

gpg -K --keyid-format long --with-colons --with-fingerprint

Export the one you want (look next to sec:u:256:22)

gpg --export -a 93B3BB2C9F7F5BA4

Export a public key in a human-readable format:

gpg --output bcunnie.gpg --export --armor [email protected]

Configure git to use your key:

git config --global user.signingkey 93B3BB2C9F7F5BA4
git config --global commit.gpgsign true

To fix error: gpg failed to sign the data when committing

export GPG_TTY=$(tty)

To delete a key:

gpg --list-keys
...
pub   ed25519 2018-10-11 [SC] [expires: 2024-10-09]
      FB79E69D115334D081A56A032BBE9A01CFC8E752
uid           [ unknown] Brian Cunnie <[email protected]>
uid           [ unknown] Rowan Jacobs <[email protected]>
sub   cv25519 2018-10-11 [E] [expires: 2024-10-09]

gpg --delete-secret-keys  FB79E69D115334D081A56A032BBE9A01CFC8E752
  # MANY confirmations
gpg --delete-key FB79E69D115334D081A56A032BBE9A01CFC8E752

To edit a key:

gpg --list-keys
...
pub   ed25519 2018-07-17 [SC] [expires: 2024-07-15]
      08A8C8E8C9A1D3350413FA2E93B3BB2C9F7F5BA4
uid           [ultimate] Brian Cunnie (Work email) <[email protected]>
uid           [ultimate] Brian Cunnie <[email protected]>
sub   cv25519 2018-07-17 [E] [expires: 2024-07-15]

gpg --edit-key 08A8C8E8C9A1D3350413FA2E93B3BB2C9F7F5BA4
  uid
    sec  ed25519/93B3BB2C9F7F5BA4
	 created: 2018-07-17  expires: 2024-07-15  usage: SC
	 trust: ultimate      validity: ultimate
    ssb  cv25519/B56458A7AE187951
	 created: 2018-07-17  expires: 2024-07-15  usage: E
    [ultimate] (1). Brian Cunnie (Work email) <[email protected]>
    [ultimate] (2)  Brian Cunnie <[email protected]>
  uid 1
  deluid
  adduid
    Real name: Brian Cunnie
    Email address: [email protected]
  save