Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command that can be given to GnuPG: to add user ID without having to go through the Key Edit menu.

We need to be able to add and delete User IDs from inside a Python program. It would be wonderful if there was a way to do that with one single line. Does anyone know how to do that?

Thank you in advance. Vivarto

share|improve this question

There isn't any way to do that without editing the key and even if there was, you still wouldn't be able to get it down to one line because modification of a key requires verification (entering your passphrase and interactive answering of questions that you really want to do it).

share|improve this answer
Thank you. I was hoping for another answer, however I have to live with facts, not dreams:) – Vivarto Sep 30 '13 at 4:11
I'd say "no problem" except clearly it is. ;) Theoretically a lot of coding might enable you to get part of the way there (you'd still need to deal with the passphrase), but it would involve reimplementing large chunks of the OpenPGP spec and if you're not already subscribed to the IETF WG list then you really don't know how much pain that would involve. I'm not going to say don't try, but I will say that it ain't no shortcut. – Ben Sep 30 '13 at 4:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.