how not to generate s.gpg-agent while creating new keys

135 views
Skip to first unread message

Crocodile

unread,
Dec 27, 2011, 4:51:27 AM12/27/11
to python-gnupg
After creating keys with:
key = gpg.gen_key(input_data)
I noticed that S.gpg-agent is also generated. Is there a way to NOT
generate S.gpg-agent?
Thank you in advance for any help with this.

Vinay Sajip

unread,
Dec 27, 2011, 6:53:06 AM12/27/11
to python-gnupg

On Dec 27, 9:51 am, Crocodile <viva...@gmail.com> wrote:
> After creating keys with:
> key = gpg.gen_key(input_data)
> I noticed that S.gpg-agent is also generated. Is there a way to NOT
> generate S.gpg-agent?

I can't reproduce this - what version of gpg are you using, and on
which OS? AFAIK S.gpg-agent is a socket file used to communicate with
the gpg-agent, so I presume you can delete it without problems if
you're not using the gpg-agent.

Regards,

Vinay Sajip

gseattle

unread,
Jan 3, 2012, 4:57:15 PM1/3/12
to python-gnupg
> I can't reproduce this - what version of gpg are you using, and on
> which OS?

I saw this using gpg.exe 1.4.11 on Windows 7 with Gpg4Win installed
(others like WinPT and PGPTray also on the system). It appeared that
gnupg.py found the gpg4win's gpg.exe, which started gpg2.exe which
started gpg-agent.exe which created S.gpg-agent, and then gpg-
agent.exe would keep running, and also dbus-daemon.exe started. I'm
still not clear on exactly how that happened. The goal was
simplicity, to sidestep any other products and just call gpg.exe
1.4.11, and 'gpgbinary' (shown below) resolved that.

Some python code below for tinkering if someone wants to try to
reproduce it (you'll need gpg.exe and iconv.dll in the current dir).

By adding the gpgbinary arg to specify the full path to gpg.exe
including the 'gpg.exe' itself, that kept other encryption products
from crashing the party (via registry keys or whatever). Previously I
had interpreted the documentation incorrectly and simply did not use
gpgbinary. The docs say:

gpgbinary (defaults to “gpg”)
The path to the gpg executable.

[...maybe add an example full path to that to help insure clarity].

#!python

import os
import gnupg # http://packages.python.org/python-gnupg/

gpg_home = os.environ['APPDATA'] + "\\gnupg"
gpg_binary = os.getcwd() + "\\gpg.exe"
#gpg = gnupg.GPG(gnupghome = gpg_home, verbose = True)
gpg = gnupg.GPG(gnupghome = gpg_home, verbose = True, gpgbinary
= gpg_binary)

input_data = gpg.gen_key_input(
key_length = 2048,
subkey_length = 2048,
key_type = "RSA",
subkey_type = "RSA",
name_real = "sam juan",
name_email = "som...@somewhere.com",
name_comment = "by gnupg.py",
passphrase = 'zzoo'
)

print "Creating keys"
key = gpg.gen_key(input_data)

print gpg.list_keys() # public keys
print gpg.list_keys(True) # secret keys






Reply all
Reply to author
Forward
0 new messages