Skip to content

Instantly share code, notes, and snippets.

@ProbieK
Forked from troyfontaine/1-setup.md
Last active July 15, 2020 16:55
Show Gist options
  • Select an option

  • Save ProbieK/e7c40f2485173407da817f7a307cfb6e to your computer and use it in GitHub Desktop.

Select an option

Save ProbieK/e7c40f2485173407da817f7a307cfb6e to your computer and use it in GitHub Desktop.

Revisions

  1. @troyfontaine troyfontaine revised this gist Aug 7, 2019. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion 2-using-gpg.md
    Original file line number Diff line number Diff line change
    @@ -19,14 +19,19 @@ If this file does not exist, create it.
    use-agent

    ## Step 4: Modify your Shell
    Append the following to your ~/.bashrc or ~/.zshrc
    Append the following to your ~/.bash_profile or ~/.bashrc or ~/.zshrc

    ...
    export GPG_TTY=`tty`

    ## Step 5: Restart your Terminal or source your ~/.*rc file

    # on the built-in bash on macos use
    source ~/.bash_profile
    # if using bash through homebrew over ssh use
    source ~/.bashrc
    # and if using zsh
    source ~/.zshrc

    ## Step 6: Create your GPG Key
    Run the following command to generate your key, note we have to use the `--expert` flag so as to generate a 4096-bit key.
  2. @troyfontaine troyfontaine revised this gist Jun 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 2-using-gpg.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ If this file does not exist, create it.
    Append the following to your ~/.bashrc or ~/.zshrc

    ...
    export GPG_TTY="tty"
    export GPG_TTY=`tty`

    ## Step 5: Restart your Terminal or source your ~/.*rc file

  3. @troyfontaine troyfontaine revised this gist Jun 12, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 2-using-gpg.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    ## Step 1: Install software
    We use the Homebrew package manager for this step.

    brew install gpg2 gpg-agent pinentry-mac
    brew install gpg2 gnupg pinentry-mac

    ## Step 2: Update ~/.gnupg/gpg-agent.conf
    If this file does not exist, create it.
  4. @troyfontaine troyfontaine revised this gist Feb 21, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion 2-using-gpg.md
    Original file line number Diff line number Diff line change
    @@ -116,8 +116,9 @@ This tells Git to sign all commits using the key you specified in step 13.
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    ## Step 17: Submit your PGP key to Github to verify your Commits
    Login into Github.com and go to your settings, SSH and GPG Keys, and add your GPG key from the page.

    ## Step 17: Submitting Your Key to a Public Keyserver (very optional)
    ## Step 18: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
  5. @troyfontaine troyfontaine revised this gist Feb 21, 2018. 3 changed files with 24 additions and 14 deletions.
    4 changes: 3 additions & 1 deletion 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,6 @@ There are now two ways to approach this:
    1. Using gpg and generating keys
    2. Using Kryptonite by krypt.co

    This Gist explains how to do this using gpg. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions [here](4-GUI-git-signing.md) for using Kryptonite with GUI-based Git applications.
    This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

    For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps [here](4-GUI-git-signing.md) for signing with either GPG or Krypt.co.
    13 changes: 0 additions & 13 deletions 2-using-gpg.md
    Original file line number Diff line number Diff line change
    @@ -123,19 +123,6 @@ Before you jump on submitting your key to a service such as the [MIT PGP Key Ser
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    ## Step 18: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)

    ### Step 18a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ### Step 18b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    # Troubleshooting
    If you have any errors when generating a key regarding gpg-agent, try the following command to see what error it generates:

    21 changes: 21 additions & 0 deletions 4-GUI-git-signing.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,26 @@
    # Git Signing with a GUI Application (e.g. Tower or Github)

    ## Manually Installed GPG

    ### Step 1: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ### Step 2: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ## Step 3: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 4: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.

    ## Using Krypt.co

    ## Step 1: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

  6. @troyfontaine troyfontaine revised this gist Feb 21, 2018. 5 changed files with 151 additions and 150 deletions.
    151 changes: 1 addition & 150 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -4,153 +4,4 @@ There are now two ways to approach this:
    1. Using gpg and generating keys
    2. Using Kryptonite by krypt.co

    This Gist explains how to do this using gpg. Kryptonite is actually wickedly easy to use-but you will still need Steps 18c and 18d for using Kryptonite with GUI-based Git applications.

    # Using GPG

    ## Step 1: Install software
    We use the Homebrew package manager for this step.

    brew install gpg2 gpg-agent pinentry-mac

    ## Step 2: Update ~/.gnupg/gpg-agent.conf
    If this file does not exist, create it.

    # Insert the following text
    pinentry-program /usr/local/bin/pinentry-mac

    ## Step 3: Update or Create ~/.gnupg/gpg.conf
    If this file does not exist, create it.

    # Uncomment within config (or add this line)
    # This tells gpg to use the gpg-agent
    use-agent

    ## Step 4: Modify your Shell
    Append the following to your ~/.bashrc or ~/.zshrc

    ...
    export GPG_TTY="tty"

    ## Step 5: Restart your Terminal or source your ~/.*rc file

    source ~/.bashrc

    ## Step 6: Create your GPG Key
    Run the following command to generate your key, note we have to use the `--expert` flag so as to generate a 4096-bit key.

    gpg --full-gen-key

    ## Step 7: Update the Permissions on your ~/.gnupg Directory
    You will need to modify the permissions to 700 to secure this directory.

    chmod 700 ~/.gnupg

    ## Step 8: Answer the Questions
    Once you have entered your options, pinentry will prompt you for a password for the new PGP key.

    Please select what kind of key you want:
    (1) RSA and RSA (default)
    (2) DSA and Elgamal
    (3) DSA (sign only)
    (4) RSA (sign only)
    Your selection? 4
    RSA keys may be between 1024 and 4096 bits long.
    What keysize do you want? (2048) 4096
    Requested keysize is 4096 bits
    Please specify how long the key should be valid.
    0 = key does not expire
    <n> = key expires in n days
    <n>w = key expires in n weeks
    <n>m = key expires in n months
    <n>y = key expires in n years
    Key is valid for? (0) 3y
    Key does not expire at all
    Is this correct? (y/N) y

    You need a user ID to identify your key; the software constructs the user ID
    from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <[email protected]>"

    Real name: Dr Duh
    Email address: [email protected]
    Comment:
    You selected this USER-ID:
    "Dr Duh <[email protected]>"

    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.

    ## Step 9: Get your key info for Git, etc.

    # List your keys
    gpg -k

    ## Step 10: Get your key id
    Use the next command to generate a short form of the key fingerprint.

    Copy the text after the `rsa4096/` and before the date generated and use the copied id in step 13:

    gpg -K --keyid-format SHORT
    sec rsa4096/######## YYYY-MM-DD [SC] [expires: YYYY-MM-DD]

    *You need to copy the output similar to the example above where the ######## is.*

    ## Step 11: Export the fingerprint
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the <your key id> placeholder. The output from below is what you copy to Github:

    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    ## Step 12: Configure Git to use gpg

    git config --global gpg.program $(which gpg)

    ## Step 13: Configure Git to use your signing key
    The below command needs the fingerprint from step 10 above:

    git config --global user.signingkey 1111111

    ## Step 14: Configure Git to sign all commits (Optional-you can configure this per repository too)
    This tells Git to sign all commits using the key you specified in step 13.

    git config --global commit.gpgsign true

    ## Step 15: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    ## Step 16: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    ## Step 17: Submit your PGP key to Github to verify your Commits

    ## Step 17: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    ## Step 18: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)

    ### Step 18a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ### Step 18b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ### Step 18c: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ### Step 18d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.

    # Troubleshooting
    If you have any errors when generating a key regarding gpg-agent, try the following command to see what error it generates:

    gpg-agent --daemon
    This Gist explains how to do this using gpg. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions [here](4-GUI-git-signing.md) for using Kryptonite with GUI-based Git applications.
    142 changes: 142 additions & 0 deletions 2-using-gpg.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,142 @@
    # Using GPG

    ## Step 1: Install software
    We use the Homebrew package manager for this step.

    brew install gpg2 gpg-agent pinentry-mac

    ## Step 2: Update ~/.gnupg/gpg-agent.conf
    If this file does not exist, create it.

    # Insert the following text
    pinentry-program /usr/local/bin/pinentry-mac

    ## Step 3: Update or Create ~/.gnupg/gpg.conf
    If this file does not exist, create it.

    # Uncomment within config (or add this line)
    # This tells gpg to use the gpg-agent
    use-agent

    ## Step 4: Modify your Shell
    Append the following to your ~/.bashrc or ~/.zshrc

    ...
    export GPG_TTY="tty"

    ## Step 5: Restart your Terminal or source your ~/.*rc file

    source ~/.bashrc

    ## Step 6: Create your GPG Key
    Run the following command to generate your key, note we have to use the `--expert` flag so as to generate a 4096-bit key.

    gpg --full-gen-key

    ## Step 7: Update the Permissions on your ~/.gnupg Directory
    You will need to modify the permissions to 700 to secure this directory.

    chmod 700 ~/.gnupg

    ## Step 8: Answer the Questions
    Once you have entered your options, pinentry will prompt you for a password for the new PGP key.

    Please select what kind of key you want:
    (1) RSA and RSA (default)
    (2) DSA and Elgamal
    (3) DSA (sign only)
    (4) RSA (sign only)
    Your selection? 4
    RSA keys may be between 1024 and 4096 bits long.
    What keysize do you want? (2048) 4096
    Requested keysize is 4096 bits
    Please specify how long the key should be valid.
    0 = key does not expire
    <n> = key expires in n days
    <n>w = key expires in n weeks
    <n>m = key expires in n months
    <n>y = key expires in n years
    Key is valid for? (0) 3y
    Key does not expire at all
    Is this correct? (y/N) y

    You need a user ID to identify your key; the software constructs the user ID
    from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <[email protected]>"

    Real name: Dr Duh
    Email address: [email protected]
    Comment:
    You selected this USER-ID:
    "Dr Duh <[email protected]>"

    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.

    ## Step 9: Get your key info for Git, etc.

    # List your keys
    gpg -k

    ## Step 10: Get your key id
    Use the next command to generate a short form of the key fingerprint.

    Copy the text after the `rsa4096/` and before the date generated and use the copied id in step 13:

    gpg -K --keyid-format SHORT
    sec rsa4096/######## YYYY-MM-DD [SC] [expires: YYYY-MM-DD]

    *You need to copy the output similar to the example above where the ######## is.*

    ## Step 11: Export the fingerprint
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the <your key id> placeholder. The output from below is what you copy to Github:

    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    ## Step 12: Configure Git to use gpg

    git config --global gpg.program $(which gpg)

    ## Step 13: Configure Git to use your signing key
    The below command needs the fingerprint from step 10 above:

    git config --global user.signingkey 1111111

    ## Step 14: Configure Git to sign all commits (Optional-you can configure this per repository too)
    This tells Git to sign all commits using the key you specified in step 13.

    git config --global commit.gpgsign true

    ## Step 15: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    ## Step 16: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    ## Step 17: Submit your PGP key to Github to verify your Commits

    ## Step 17: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    ## Step 18: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)

    ### Step 18a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ### Step 18b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    # Troubleshooting
    If you have any errors when generating a key regarding gpg-agent, try the following command to see what error it generates:

    gpg-agent --daemon
    1 change: 1 addition & 0 deletions 3-using-krypt.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # Krypt.co
    7 changes: 7 additions & 0 deletions 4-GUI-git-signing.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # Git Signing with a GUI Application (e.g. Tower or Github)

    ## Step 1: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 2: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.
    File renamed without changes.
  7. @troyfontaine troyfontaine revised this gist Dec 20, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions 2-helpful-urls.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    https://help.github.com/enterprise/2.11/user/articles/signing-commits-using-gpg/
    http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/
    https://help.github.com/articles/associating-an-email-with-your-gpg-key/
    https://help.github.com/enterprise/2.11/user/articles/signing-commits-using-gpg/
    http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/
    https://help.github.com/articles/associating-an-email-with-your-gpg-key/
  8. @troyfontaine troyfontaine revised this gist Dec 20, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions 2-helpful-urls.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    https://help.github.com/enterprise/2.11/user/articles/signing-commits-using-gpg/
    http://irtfweb.ifa.hawaii.edu/~lockhart/gpg/
    https://help.github.com/articles/associating-an-email-with-your-gpg-key/
  9. @troyfontaine troyfontaine revised this gist Dec 15, 2017. 1 changed file with 25 additions and 23 deletions.
    48 changes: 25 additions & 23 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -6,45 +6,47 @@ There are now two ways to approach this:

    This Gist explains how to do this using gpg. Kryptonite is actually wickedly easy to use-but you will still need Steps 18c and 18d for using Kryptonite with GUI-based Git applications.

    # Step 1: Install software
    # Using GPG

    ## Step 1: Install software
    We use the Homebrew package manager for this step.

    brew install gpg2 gpg-agent pinentry-mac

    # Step 2: Update ~/.gnupg/gpg-agent.conf
    ## Step 2: Update ~/.gnupg/gpg-agent.conf
    If this file does not exist, create it.

    # Insert the following text
    pinentry-program /usr/local/bin/pinentry-mac

    # Step 3: Update or Create ~/.gnupg/gpg.conf
    ## Step 3: Update or Create ~/.gnupg/gpg.conf
    If this file does not exist, create it.

    # Uncomment within config (or add this line)
    # This tells gpg to use the gpg-agent
    use-agent

    # Step 4: Modify your Shell
    ## Step 4: Modify your Shell
    Append the following to your ~/.bashrc or ~/.zshrc

    ...
    export GPG_TTY="tty"

    # Step 5: Restart your Terminal or source your ~/.*rc file
    ## Step 5: Restart your Terminal or source your ~/.*rc file

    source ~/.bashrc

    # Step 6: Create your GPG Key
    ## Step 6: Create your GPG Key
    Run the following command to generate your key, note we have to use the `--expert` flag so as to generate a 4096-bit key.

    gpg --full-gen-key

    # Step 7: Update the Permissions on your ~/.gnupg Directory
    ## Step 7: Update the Permissions on your ~/.gnupg Directory
    You will need to modify the permissions to 700 to secure this directory.

    chmod 700 ~/.gnupg

    # Step 8: Answer the Questions
    ## Step 8: Answer the Questions
    Once you have entered your options, pinentry will prompt you for a password for the new PGP key.

    Please select what kind of key you want:
    @@ -79,12 +81,12 @@ Once you have entered your options, pinentry will prompt you for a password for
    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.

    # Step 9: Get your key info for Git, etc.
    ## Step 9: Get your key info for Git, etc.

    # List your keys
    gpg -k

    # Step 10: Get your key id
    ## Step 10: Get your key id
    Use the next command to generate a short form of the key fingerprint.

    Copy the text after the `rsa4096/` and before the date generated and use the copied id in step 13:
    @@ -94,58 +96,58 @@ Copy the text after the `rsa4096/` and before the date generated and use the cop

    *You need to copy the output similar to the example above where the ######## is.*

    # Step 11: Export the fingerprint
    ## Step 11: Export the fingerprint
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the <your key id> placeholder. The output from below is what you copy to Github:

    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    # Step 12: Configure Git to use gpg
    ## Step 12: Configure Git to use gpg

    git config --global gpg.program $(which gpg)

    # Step 13: Configure Git to use your signing key
    ## Step 13: Configure Git to use your signing key
    The below command needs the fingerprint from step 10 above:

    git config --global user.signingkey 1111111

    # Step 14: Configure Git to sign all commits (Optional-you can configure this per repository too)
    ## Step 14: Configure Git to sign all commits (Optional-you can configure this per repository too)
    This tells Git to sign all commits using the key you specified in step 13.

    git config --global commit.gpgsign true

    # Step 15: Perform a Commit
    ## Step 15: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    # Step 16: Pinentry Prompt
    ## Step 16: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    # Step 17: Submit your PGP key to Github to verify your Commits
    ## Step 17: Submit your PGP key to Github to verify your Commits

    # Step 17: Submitting Your Key to a Public Keyserver (very optional)
    ## Step 17: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 18: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)
    ## Step 18: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)

    ## Step 18a: Modify ~/.gnupg/gpg-agent.conf
    ### Step 18a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ## Step 18b: Modify ~/.gnupg/gpg.conf
    ### Step 18b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ## Step 18c: Copy startup-gpg-agent.sh to ~/bin/
    ### Step 18c: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 18d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    ### Step 18d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.

    # Troubleshooting
  10. @troyfontaine troyfontaine revised this gist Dec 15, 2017. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    # Methods of Signing with GPG

    There are now two ways to approach this:
    1. Using gpg and generating keys
    2. Using Kryptonite by krypt.co

    This Gist explains how to do this using gpg. Kryptonite is actually wickedly easy to use-but you will still need Steps 18c and 18d for using Kryptonite with GUI-based Git applications.

    # Step 1: Install software
    We use the Homebrew package manager for this step.

  11. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -87,7 +87,7 @@ Copy the text after the `rsa4096/` and before the date generated and use the cop
    *You need to copy the output similar to the example above where the ######## is.*

    # Step 11: Export the fingerprint
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step:
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the <your key id> placeholder. The output from below is what you copy to Github:

    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>
    @@ -113,6 +113,8 @@ This tells Git to sign all commits using the key you specified in step 13.
    # Step 16: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    # Step 17: Submit your PGP key to Github to verify your Commits

    # Step 17: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
  12. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -83,6 +83,8 @@ Copy the text after the `rsa4096/` and before the date generated and use the cop

    gpg -K --keyid-format SHORT
    sec rsa4096/######## YYYY-MM-DD [SC] [expires: YYYY-MM-DD]

    *You need to copy the output similar to the example above where the ######## is.*

    # Step 11: Export the fingerprint
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step:
  13. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -77,9 +77,12 @@ Once you have entered your options, pinentry will prompt you for a password for
    gpg -k

    # Step 10: Get your key id
    Use the next command to generate a short form of the key fingerprint. Copy the text after the rsa4096/ and before the date and use that in step 13:
    Use the next command to generate a short form of the key fingerprint.

    Copy the text after the `rsa4096/` and before the date generated and use the copied id in step 13:

    gpg -K --keyid-format SHORT
    sec rsa4096/######## YYYY-MM-DD [SC] [expires: YYYY-MM-DD]

    # Step 11: Export the fingerprint
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step:
  14. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -77,12 +77,12 @@ Once you have entered your options, pinentry will prompt you for a password for
    gpg -k

    # Step 10: Get your key id
    Use the next command to generate a short form of the key fingerprint. Copy the text after the rsa4096/ and before the date and use that in the below user.signingkey command:
    Use the next command to generate a short form of the key fingerprint. Copy the text after the rsa4096/ and before the date and use that in step 13:

    gpg -K --keyid-format SHORT

    # Step 11: Export the fingerprint
    In the output, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step:
    In the output from step 10, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step:

    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>
  15. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 25 additions and 12 deletions.
    37 changes: 25 additions & 12 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -75,49 +75,62 @@ Once you have entered your options, pinentry will prompt you for a password for

    # List your keys
    gpg -k
    # Use the next command to generate a short form of the key fingerprint. Copy the text after the rsa4096/ and before the date and use that in the below user.signingkey command

    # Step 10: Get your key id
    Use the next command to generate a short form of the key fingerprint. Copy the text after the rsa4096/ and before the date and use that in the below user.signingkey command:

    gpg -K --keyid-format SHORT
    # In the output, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step

    # Step 11: Export the fingerprint
    In the output, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step:

    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    # Step 10: Configure Git to use your key
    # Step 12: Configure Git to use gpg

    git config --global gpg.program $(which gpg)
    # The below command needs the fingerprint from the step above

    # Step 13: Configure Git to use your signing key
    The below command needs the fingerprint from step 10 above:

    git config --global user.signingkey 1111111

    # Step 14: Configure Git to sign all commits (Optional-you can configure this per repository too)
    This tells Git to sign all commits using the key you specified in step 13.

    git config --global commit.gpgsign true

    # Step 11: Perform a Commit
    # Step 15: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    # Step 12: Pinentry Prompt
    # Step 16: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    # Step 13: Submitting Your Key to a Public Keyserver (very optional)
    # Step 17: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 14: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)
    # Step 18: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)

    ## Step 14a: Modify ~/.gnupg/gpg-agent.conf
    ## Step 18a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ## Step 14b: Modify ~/.gnupg/gpg.conf
    ## Step 18b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ## Step 14c: Copy startup-gpg-agent.sh to ~/bin/
    ## Step 18c: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 14d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    ## Step 18d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.

    # Troubleshooting
  16. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -101,7 +101,7 @@ Before you jump on submitting your key to a service such as the [MIT PGP Key Ser
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 14: Enabling signing with Git Tower
    # Step 14: Enabling signing with a Git GUI tool (Only do this if you use Git Tower or Github Desktop)

    ## Step 14a: Modify ~/.gnupg/gpg-agent.conf

  17. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 16 additions and 11 deletions.
    27 changes: 16 additions & 11 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,12 @@ Run the following command to generate your key, note we have to use the `--exper

    gpg --full-gen-key

    # Step 7: Answer the Questions
    # Step 7: Update the Permissions on your ~/.gnupg Directory
    You will need to modify the permissions to 700 to secure this directory.

    chmod 700 ~/.gnupg

    # Step 8: Answer the Questions
    Once you have entered your options, pinentry will prompt you for a password for the new PGP key.

    Please select what kind of key you want:
    @@ -66,7 +71,7 @@ Once you have entered your options, pinentry will prompt you for a password for
    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.

    # Step 8: Get your key info for Git, etc.
    # Step 9: Get your key info for Git, etc.

    # List your keys
    gpg -k
    @@ -76,43 +81,43 @@ Once you have entered your options, pinentry will prompt you for a password for
    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    # Step 9: Configure Git to use your key
    # Step 10: Configure Git to use your key

    git config --global gpg.program $(which gpg)
    # The below command needs the fingerprint from the step above
    git config --global user.signingkey 1111111
    git config --global commit.gpgsign true

    # Step 10: Perform a Commit
    # Step 11: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    # Step 11: Pinentry Prompt
    # Step 12: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    # Step 12: Submitting Your Key to a Public Keyserver
    # Step 13: Submitting Your Key to a Public Keyserver (very optional)
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 13: Enabling signing with Git Tower
    # Step 14: Enabling signing with Git Tower

    ## Step 13a: Modify ~/.gnupg/gpg-agent.conf
    ## Step 14a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ## Step 13b: Modify ~/.gnupg/gpg.conf
    ## Step 14b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ## Step 13c: Copy startup-gpg-agent.sh to ~/bin/
    ## Step 14c: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 13d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    ## Step 14d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.

    # Troubleshooting
  18. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -113,4 +113,9 @@ Before you jump on submitting your key to a service such as the [MIT PGP Key Ser
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 13d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.

    # Troubleshooting
    If you have any errors when generating a key regarding gpg-agent, try the following command to see what error it generates:

    gpg-agent --daemon
  19. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 17 additions and 13 deletions.
    30 changes: 17 additions & 13 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -21,13 +21,17 @@ Append the following to your ~/.bashrc or ~/.zshrc

    ...
    export GPG_TTY="tty"

    # Step 5: Create your GPG Key

    # Step 5: Restart your Terminal or source your ~/.*rc file

    source ~/.bashrc

    # Step 6: Create your GPG Key
    Run the following command to generate your key, note we have to use the `--expert` flag so as to generate a 4096-bit key.

    gpg --full-gen-key

    # Step 6: Answer the Questions
    # Step 7: Answer the Questions
    Once you have entered your options, pinentry will prompt you for a password for the new PGP key.

    Please select what kind of key you want:
    @@ -62,7 +66,7 @@ Once you have entered your options, pinentry will prompt you for a password for
    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.

    # Step 7: Get your key info for Git, etc.
    # Step 8: Get your key info for Git, etc.

    # List your keys
    gpg -k
    @@ -72,41 +76,41 @@ Once you have entered your options, pinentry will prompt you for a password for
    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    # Step 8: Configure Git to use your key
    # Step 9: Configure Git to use your key

    git config --global gpg.program $(which gpg)
    # The below command needs the fingerprint from the step above
    git config --global user.signingkey 1111111
    git config --global commit.gpgsign true

    # Step 9: Perform a Commit
    # Step 10: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    # Step 10: Pinentry Prompt
    # Step 11: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    # Step 11: Submitting Your Key to a Public Keyserver
    # Step 12: Submitting Your Key to a Public Keyserver
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 12: Enabling signing with Git Tower
    # Step 13: Enabling signing with Git Tower

    ## Step 12a: Modify ~/.gnupg/gpg-agent.conf
    ## Step 13a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ## Step 12b: Modify ~/.gnupg/gpg.conf
    ## Step 13b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ## Step 12c: Copy startup-gpg-agent.sh to ~/bin/
    ## Step 13c: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 12d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    ## Step 13d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.
  20. @troyfontaine troyfontaine revised this gist Dec 12, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -4,11 +4,13 @@ We use the Homebrew package manager for this step.
    brew install gpg2 gpg-agent pinentry-mac

    # Step 2: Update ~/.gnupg/gpg-agent.conf
    If this file does not exist, create it.

    # Insert the following text
    pinentry-program /usr/local/bin/pinentry-mac

    # Step 3: Update or Create ~/.gnupg/gpg.conf
    If this file does not exist, create it.

    # Uncomment within config (or add this line)
    # This tells gpg to use the gpg-agent
  21. @troyfontaine troyfontaine revised this gist Nov 30, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,7 @@ Once you have entered your options, pinentry will prompt you for a password for

    # Step 8: Configure Git to use your key

    git config --global gpg.program gpg
    git config --global gpg.program $(which gpg)
    # The below command needs the fingerprint from the step above
    git config --global user.signingkey 1111111
    git config --global commit.gpgsign true
  22. @troyfontaine troyfontaine revised this gist Nov 28, 2017. 2 changed files with 15 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -103,5 +103,8 @@ Before you jump on submitting your key to a service such as the [MIT PGP Key Ser
    use-agent
    no-tty

    ## Step 12c: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the other file in this Gist to ~/Library/LaunchAgents/.
    ## Step 12c: Copy startup-gpg-agent.sh to ~/bin/
    Copy the .sh file in this gist to `~/bin/`.

    ## Step 12d: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the the plist file in this Gist to `~/Library/LaunchAgents/`.
    10 changes: 10 additions & 0 deletions startup-gpg-agent.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Ensure that gpg can find the agent when needed
    if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
    source ~/.gnupg/.gpg-agent-info
    export GPG_AGENT_INFO
    else
    eval $(gpg-agent --daemon --write-env-file ~/.gnupg/.gpg-agent-info)
    fi

    # This line is important for GUI tools to also find it
    launchctl setenv GPG_AGENT_INFO $GPG_AGENT_INFO
  23. @troyfontaine troyfontaine revised this gist Nov 28, 2017. 2 changed files with 30 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions setup.md → 1-setup.md
    Original file line number Diff line number Diff line change
    @@ -91,3 +91,17 @@ Before you jump on submitting your key to a service such as the [MIT PGP Key Ser
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 12: Enabling signing with Git Tower

    ## Step 12a: Modify ~/.gnupg/gpg-agent.conf

    use-standard-socket
    pinentry-program /usr/local/bin/pinentry-mac
    enable-ssh-support

    ## Step 12b: Modify ~/.gnupg/gpg.conf

    use-agent
    no-tty

    ## Step 12c: Copy org.gnupg.gpg-agent.plist file to ~/Library/LaunchAgents/
    Copy the other file in this Gist to ~/Library/LaunchAgents/.
    16 changes: 16 additions & 0 deletions org.gnupg.gpg-agent.plist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <!-- This needs to be placed at ~/Library/LaunchAgents/org.gnupg.gpg-agent.plist -->
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.gnupg.gpg-agent</string>
    <key>ProgramArguments</key>
    <array>
    <!-- Be sure to set this path correctly! -->
    <string>/Users/yourusername/bin/start-gpg-agent.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist>
  24. @troyfontaine troyfontaine revised this gist Nov 28, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion setup.md
    Original file line number Diff line number Diff line change
    @@ -88,4 +88,6 @@ You will now be prompted by Pinentry for the password for your signing key. You
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary
    - If you're only signing your Git commits to Github this isn't necessary

    # Step 12: Enabling signing with Git Tower
  25. @troyfontaine troyfontaine revised this gist Nov 6, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions setup.md
    Original file line number Diff line number Diff line change
    @@ -64,6 +64,8 @@ Once you have entered your options, pinentry will prompt you for a password for

    # List your keys
    gpg -k
    # Use the next command to generate a short form of the key fingerprint. Copy the text after the rsa4096/ and before the date and use that in the below user.signingkey command
    gpg -K --keyid-format SHORT
    # In the output, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step
    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>
  26. @troyfontaine troyfontaine revised this gist Aug 5, 2017. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions setup.md
    Original file line number Diff line number Diff line change
    @@ -13,11 +13,6 @@ We use the Homebrew package manager for this step.
    # Uncomment within config (or add this line)
    # This tells gpg to use the gpg-agent
    use-agent

    # Silences the "you need a passphrase" message
    # This is a potential source of issues, but I haven't noticed any
    # Breaks new key generation-disable when generating new keys
    #batch

    # Step 4: Modify your Shell
    Append the following to your ~/.bashrc or ~/.zshrc
  27. @troyfontaine troyfontaine revised this gist Aug 5, 2017. No changes.
  28. @troyfontaine troyfontaine revised this gist Aug 5, 2017. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions setup.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    # Step 1: Install software
    We use the Homebrew package manager for this step.

    brew install gpg2 gpg-agent pinentry-mac

    brew install gpg2 gpg-agent pinentry-mac

    # Step 2: Update ~/.gnupg/gpg-agent.conf

    @@ -86,4 +85,10 @@ Once you have entered your options, pinentry will prompt you for a password for
    git commit -S -s -m "My Signed Commit"

    # Step 10: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.

    # Step 11: Submitting Your Key to a Public Keyserver
    Before you jump on submitting your key to a service such as the [MIT PGP Key Server](https://pgp.mit.edu), you should consider the following:
    - You cannot delete your key once submitted
    - Spammers have been known to harvest email addresses from these servers
    - If you're only signing your Git commits to Github this isn't necessary
  29. @troyfontaine troyfontaine revised this gist Aug 5, 2017. 1 changed file with 17 additions and 6 deletions.
    23 changes: 17 additions & 6 deletions setup.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,8 @@ We use the Homebrew package manager for this step.

    # Silences the "you need a passphrase" message
    # This is a potential source of issues, but I haven't noticed any
    batch
    # Breaks new key generation-disable when generating new keys
    #batch

    # Step 4: Modify your Shell
    Append the following to your ~/.bashrc or ~/.zshrc
    @@ -28,9 +29,10 @@ Append the following to your ~/.bashrc or ~/.zshrc
    # Step 5: Create your GPG Key
    Run the following command to generate your key, note we have to use the `--expert` flag so as to generate a 4096-bit key.

    gpg --gen-key --expert
    gpg --full-gen-key

    # Step 6: Answer the Questions
    Once you have entered your options, pinentry will prompt you for a password for the new PGP key.

    Please select what kind of key you want:
    (1) RSA and RSA (default)
    @@ -47,7 +49,7 @@ Run the following command to generate your key, note we have to use the `--exper
    <n>w = key expires in n weeks
    <n>m = key expires in n months
    <n>y = key expires in n years
    Key is valid for? (0) 0
    Key is valid for? (0) 3y
    Key does not expire at all
    Is this correct? (y/N) y

    @@ -64,15 +66,24 @@ Run the following command to generate your key, note we have to use the `--exper
    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.

    # Step 7: Configure Git to use your key
    # Step 7: Get your key info for Git, etc.

    # List your keys
    gpg -k
    # In the output, the line below the row that says 'pub' shows a fingerprint-this is what you use in the next step
    # The export command below gives you the key you add to GitHub
    gpg --armor --export <your key id>

    # Step 8: Configure Git to use your key

    git config --global gpg.program gpg
    # The below command needs the fingerprint from the step above
    git config --global user.signingkey 1111111
    git config --global commit.gpgsign true

    # Step 8: Perform a Commit
    # Step 9: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    # Step 9: Pinentry Prompt
    # Step 10: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.
  30. @troyfontaine troyfontaine revised this gist Aug 4, 2017. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion setup.md
    Original file line number Diff line number Diff line change
    @@ -63,4 +63,16 @@ Run the following command to generate your key, note we have to use the `--exper

    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
    You need a Passphrase to protect your secret key.


    # Step 7: Configure Git to use your key

    git config --global gpg.program gpg
    git config --global user.signingkey 1111111
    git config --global commit.gpgsign true

    # Step 8: Perform a Commit

    git commit -S -s -m "My Signed Commit"

    # Step 9: Pinentry Prompt
    You will now be prompted by Pinentry for the password for your signing key. You can enter it into the Dialog box-with the option of saving the password to the macOS X Keychain.