#89 ✓released
Alex (via GPGTools)

If no secret key was found: do not add myself when encrypting

Reported by Alex (via GPGTools) | October 18th, 2011 @ 09:57 AM | in 1.11.7b1 (closed)

Steps that will reproduce the problem?
1. Create a new user and install GPGTools
2. Open a new text window, write some text and encrypt it

What is the expected result?
Encrypted text.

What happens instead?
Error message that no secret key was found.

Possible workaround:
Uncheck the option to encrypt to myself.

Any additional information:
The checkbox should be disabled and not checked.

Comments and changes to this ticket

  • Alex (via GPGTools)

    Alex (via GPGTools) October 18th, 2011 @ 09:58 AM

    Oh, the workaround doesn't work.

  • C Fraire

    C Fraire May 23rd, 2012 @ 04:34 PM

    I think "Add to recipients" as YES by default is inline with GPGMail in that users will be normally able to decrypt things they encrypt for others.

    The error messages were changed (https://github.com/GPGTools/GPGServices/commit/9741a987aaea) and also made the same for Encrypt Selection and Encrypt File. GPGServices alerts (growling if possible) that the operation was canceled—not failed—with one of these two messages:

    "Encryption canceled" "No private key selected to add to recipients"

    "Encryption canceled" "No private key selected for signing"

  • steve

    steve May 23rd, 2012 @ 09:24 PM

    • Assigned user set to “C Fraire”

    I agree. Makes sense and by now we also have a mechanism that prompts new users without a sec key to create one in GPG Keychain Access after the GPGTools Installer is run and no sec key is detected. So not too many users should fall into this scenario.


  • steve

    steve June 22nd, 2018 @ 12:12 PM

    • State changed from “open” to “new”
    • Assigned user cleared.
    • Milestone cleared.
    • Importance changed from “” to “Low”

    Tested on
    macOS 10.13.6b
    GPG Suite 2234n


    "Your key:" is empty and "Sign" and "Add to recipients" is enabled by default. Resulting in error msg when clicking ok

    Encryption canceled
    No private key selected to add to recipients.

    Interestingly, when only using empty "Your Key:" field with "Sign" option, OK is greyed out.

    Options to handle this:

    1. When there is no sec / pub key selected (and that only happens if no sec / pub key exists at all), "Add to Recipients" should also result in a greyed out "OK" button.
    2. Keep OK active and extend error message with more details to either get in touch with support and or create a sec / pub key.
    3. Show a warning whenever GPGServices is opened and no sec / pub key exists, assuming that all our users would want to have a sec / pub key.

    Combining #3 + #1 would be an option.

  • Mento

    Mento March 21st, 2019 @ 10:35 AM

    • State changed from “new” to “fixed”
    • Assigned user set to “Mento”
    • Milestone set to 1.11.7b1
  • Support
  • steve

    steve March 21st, 2019 @ 09:32 PM

    • State changed from “fixed” to “verified”
    • Tag cleared.

    If no secret key exists, the area "Your key:" is greyed out. That way it is not possible to encrypt to self (Add to recipients) or sign.

    This makes the old error messages superfluous and prevents users from running into this situation in the first place.

    The "Encrypt" button only becomes active when something valid is selected.

    Thanks @mento for addressing this.

    macOS 10.14.4b6
    GPG Suite 2421n

  • Luke Le

    Luke Le March 22nd, 2019 @ 12:04 AM

    Is the user made aware of the fact in a dialog that the file or message they are about to encrypt won't be decryptable again? That would be very important.

  • steve

    steve March 27th, 2019 @ 01:15 PM

    Follow-up ticket is #256

  • steve

    steve April 15th, 2019 @ 12:21 AM

    • State changed from “verified” to “released”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

Referenced by