John at Mozilla-Enigmail.org
Tue Jan 20 12:14:33 CET 2009
> I want to create a frontend to generate gpg public keys in PHP. There is a
> function called shell_exec. This function, execute a command via shell. But
> you can only pass one command to the funktion.
> If I start cmd.exe and take the command "gpg --gen-key", gpg opens a dialog.
> My problem is that gpg only works with this dialog. It gives a question and
> anticipate a responce. So I tried to pipe the necessary informations with a
> txt.- file, but it doesn't work!
> My question is, if it is possible to generate keys without do that dialog?
> In an other forum, sombody explains that this is not possible, because of
> secureness... If that is true, my whole projekt stops!
> Has anybody an idea?
See the section "Unattended key generation" in the file DETAILS in the doc
directory of the source code distribution.
Here is an example:
$ cat >foo <<EOF
%echo Generating a standard key
Name-Real: Joe Tester
Name-Comment: with stupid passphrase
Name-Email: joe at foo.bar
# Do a commit here, so that we can later print "done" :-)
$ gpg --batch --gen-key foo
$ gpg --no-default-keyring --secret-keyring ./foo.sec \
--keyring ./foo.pub --list-secret-keys
sec 1024D/915A878D 2000-03-09 Joe Tester (with stupid passphrase) <joe at foo.bar>
ssb 1024g/8F70E2C0 2000-03-09
John P. Clizbe Inet:John (a) Mozilla-Enigmail.org
You can't spell fiasco without SCO. hkp://keyserver.gingerbear.net or
mailto:pgp-public-keys at gingerbear.net?subject=HELP
Q:"Just how do the residents of Haiku, Hawai'i hold conversations?"
A:"An odd melody / island voices on the winds / surplus of vowels"
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 680 bytes
Desc: OpenPGP digital signature
More information about the Gnupg-users