<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Oops, I meant to 'reply-all'.<br>
    </p>
    <div class="moz-forward-container"><br>
      <br>
      -------- Forwarded Message --------
      <table class="moz-email-headers-table" cellspacing="0"
        cellpadding="0" border="0">
        <tbody>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Subject:
            </th>
            <td>Re: gpg: signing failed: Bad secret key</td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Date: </th>
            <td>Sun, 21 Jan 2024 13:02:40 -0500</td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">From: </th>
            <td>Leo Coogan <a class="moz-txt-link-rfc2396E" href="mailto:leocoogan@mailfence.com"><leocoogan@mailfence.com></a></td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">To: </th>
            <td>Werner Koch <a class="moz-txt-link-rfc2396E" href="mailto:wk@gnupg.org"><wk@gnupg.org></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      with `verbose` added to ~/.gnupg/gpg.conf:<br>
      <br>
      ```<br>
      <br>
      <blockquote type="cite">git commit -m test<br>
      </blockquote>
      error: gpg failed to sign the data:<br>
      gpg: enabled compatibility flags:<br>
      [GNUPG:] KEY_CONSIDERED C0156FFBE02B4E03F7792EB53D7F617CDE5C9A9B 2<br>
      gpg: writing to stdout<br>
      [GNUPG:] BEGIN_SIGNING H10<br>
      gpg: signing failed: Bad secret key<br>
      [GNUPG:] FAILURE sign 67108871<br>
      gpg: signing failed: Bad secret key<br>
      <br>
      fatal: failed to write commit object<br>
      ```<br>
      <br>
      ```<br>
      <br>
      <blockquote type="cite">pass insert test<br>
      </blockquote>
      An entry already exists for test. Overwrite it? [y/N] y<br>
      Enter password for test:<br>
      Retype password for test:<br>
      gpg: enabled compatibility flags:<br>
      gpg: using pgp trust model<br>
      gpg: using subkey 63D14EA6FDB00D9F instead of primary key
      3D7F617CDE5C9A9B<br>
      gpg: automatically retrieved '<a class="moz-txt-link-abbreviated" href="mailto:leocoogan@existential.beauty">leocoogan@existential.beauty</a>' via
      Local<br>
      gpg: using subkey 63D14EA6FDB00D9F instead of primary key
      3D7F617CDE5C9A9B<br>
      gpg: This key belongs to us<br>
      gpg: reading from '[stdin]'<br>
      gpg: writing to '/home/lcoogan/.password-store/test.gpg'<br>
      gpg: ECDH/AES256.OCB encrypted for: "63D14EA6FDB00D9F Leo Coogan
      (Personal) <a class="moz-txt-link-rfc2396E" href="mailto:leocoogan@existential.beauty"><leocoogan@existential.beauty></a>"<br>
      error: gpg failed to sign the data:<br>
      gpg: enabled compatibility flags:<br>
      [GNUPG:] KEY_CONSIDERED C0156FFBE02B4E03F7792EB53D7F617CDE5C9A9B 2<br>
      gpg: writing to stdout<br>
      [GNUPG:] BEGIN_SIGNING H10<br>
      gpg: signing failed: Bad secret key<br>
      [GNUPG:] FAILURE sign 67108871<br>
      gpg: signing failed: Bad secret key<br>
      <br>
      fatal: failed to write commit object<br>
      <br>
      ```<br>
      <br>
      And on my Fedora machine were the command runs successfully:<br>
      <br>
      ```<br>
      <br>
      <blockquote type="cite">pass insert test<br>
      </blockquote>
      An entry already exists for test. Overwrite it? [y/N] y<br>
      Enter password for test:<br>
      Retype password for test:<br>
      gpg: enabled compatibility flags:<br>
      gpg: using pgp trust model<br>
      gpg: using subkey 63D14EA6FDB00D9F instead of primary key
      3D7F617CDE5C9A9B<br>
      gpg: automatically retrieved '<a class="moz-txt-link-abbreviated" href="mailto:leocoogan@existential.beauty">leocoogan@existential.beauty</a>' via
      Local<br>
      gpg: using subkey 63D14EA6FDB00D9F instead of primary key
      3D7F617CDE5C9A9B<br>
      gpg: This key belongs to us<br>
      gpg: reading from '[stdin]'<br>
      gpg: writing to '/home/lcoogan/.password-store/test.gpg'<br>
      gpg: ECDH/AES256.OCB encrypted for: "63D14EA6FDB00D9F Leo Coogan
      (Personal) <a class="moz-txt-link-rfc2396E" href="mailto:leocoogan@existential.beauty"><leocoogan@existential.beauty></a>"<br>
      [master 6800a72] Add given password for test to store.<br>
       1 file changed, 0 insertions(+), 0 deletions(-)<br>
      ```<br>
      <br>
      Not sure if that helps much.<br>
      <br>
      On 1/20/24 15:26, Werner Koch wrote:<br>
      <blockquote type="cite">On Fri, 19 Jan 2024 14:19, Leo Coogan
        said:<br>
        <blockquote type="cite">When I run `git commit -m` on nixos, I
          receive this error:<br>
        </blockquote>
        For debugging add "verbose" to ~/.gnupg/gpg.conf . This should
        give you<br>
        more information what's up.<br>
        <br>
        <br>
        Shalom-Salam,<br>
        <br>
        Werner<br>
        <br>
      </blockquote>
    </div>
  </body>
</html>