zim2901 wrote: > Hi, > > 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.
[...]From DETAILS...
Here is an example:
$ cat >foo <<EOF
%echo Generating a standard key
Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG-E
Subkey-Length: 1024
Name-Real: Joe Tester
Name-Comment: with stupid passphrase
Name-Email: [email protected]
Expire-Date: 0
Passphrase: abc
%pubring foo.pub
%secring foo.sec
# Do a commit here, so that we can later print "done" :-)
%commit
%echo done
EOF
$ gpg --batch --gen-key foo
[...]
$ gpg --no-default-keyring --secret-keyring ./foo.sec \
--keyring ./foo.pub --list-secret-keys
/home/wk/work/gnupg-stable/scratch/foo.sec
------------------------------------------
sec 1024D/915A878D 2000-03-09 Joe Tester (with stupid passphrase)
<[email protected]>
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:[email protected]?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"
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Gnupg-users mailing list [email protected] http://lists.gnupg.org/mailman/listinfo/gnupg-users
