Subject: | genkey error |
Date: | Tue, 12 Feb 2008 12:43:20 -0500 |
To: | bug-Crypt-GpgME [...] rt.cpan.org |
From: | Joel Nimety <jnimety [...] perimeterusa.com> |
I am receiving the following error when trying to generate a new key
pair using the OpenPGP engine.
GPGME: Not implemented
I believe this is because your module should be passing Null for the
Public and Secret arguments to gpgme_op_genkey per the gpgme documentation:
"GnuPG does not support PUBLIC and SECRET, they should be `NULL'.
GnuPG will generate a key pair and add it to the standard key
ring. The fingerprint of the generated key is available with
`gpgme_op_genkey_result'."
I am not familiar with Perl XS otherwise I would supply a patch to fix
this.
Thank you for a great and useful module.
Below find my test script:
#!/usr/bin/perl;
use strict;
use warnings;
use Crypt::GpgME;
use Data::Dumper;
sub _new_init_gpg {
my $ctx = Crypt::GpgME->new;
my $file_name = '/usr/bin/gpg';
my $home_dir = '/tmp/gpg_test';
$ctx->set_engine_info('OpenPGP', $file_name, $home_dir);
return $ctx;
}
my $parms = '
<GnupgKeyParms format="internal">
Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG-E
Subkey-Length: 2048
Name-Real: Joe Tester
Name-Comment: with stupid passphrase
Name-Email: joe@foo.bar
Expire-Date: 0
Passphrase: abc
</GnupgKeyParms>';
my $ctx = _new_init_gpg;
my ($result, $pubkey_fh, $seckey_fh);
($result, $pubkey_fh, $seckey_fh) = $ctx->genkey($parms);
print "$result";
--
Joel Nimety
Perimeter eSecurity
Product Architect, Email Defense
203.541.3416
jnimety@perimeterusa.com
http://www.perimeterusa.com
--
The sender of this email subscribes to Perimeter eSecurity's email
anti-virus service. This email has been scanned for malicious code and is
believed to be virus free. For more information on email security please
visit: http://www.perimeterusa.com/email-defense-content.html
This communication is confidential, intended only for the named recipient(s)
above and may contain trade secrets or other information that is exempt from
disclosure under applicable law. Any use, dissemination, distribution or
copying of this communication by anyone other than the named recipient(s) is
strictly prohibited. If you have received this communication in error, please
delete the email and immediately notify our Command Center at 203-541-3444.
Thanks