Re: Using Crypt::DSA
- From: "Sisyphus" <sisyphus1@xxxxxxxxxxxxxxxxx>
- Date: Sun, 28 Aug 2005 05:20:18 +1000
"Mike Friedman" <mikef@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>
> Here's the entirety of my little test script:
>
> ------------------------------------------
> #!/usr/local/bin/perl
>
> use Crypt::DSA;
> use strict;
>
> my $dsa = new Crypt::DSA;
> my $key = Crypt::DSA::Key->new;
> my $filename;
>
> $filename = "./dsakey";
>
> $key = $dsa->keygen (
> Size => 1024,
> Verbosity => 1,
> ) or die $dsa->errstr();
>
> $key->write(
> Type => 'PEM',
> Filename => "$filename.priv",
> );
>
> $key->priv_key(undef);
>
> $key->write(
> Type => 'PEM',
> Filename => "$filename.pub",
> );
>
> exit;
> ------------------------------------------
>
> The result is that 'dsakey.priv' and 'dsakey.pub' have exactly
> the same contents, including the 'BEGIN DSA PRIVATE KEY',
> 'END DSA PRIVATE KEY' delimiters, even though I've undefined priv_key.
> What am I doing wrong?
>
Hmmm ... I run a copy'n'paste of that script and get 2 different files. The
'.priv' file has 'BEGIN DSA PRIVATE KEY', 'END DSA PRIVATE KEY' delimiters
and the '.pub' file has 'BEGIN PUBLIC KEY', 'END PUBLIC KEY' delimiters. The
base64 content is also different. Are we using the same version of
Crypt::DSA ? (I've got 0.13 which, I think, is the latest.)
I'm on Win32 - but I don't think that's going to account for the different
behaviour (in this instance :-)
Other than that, check 'perldoc Crypt::DSA::Key' for some possible clues.
Cheers,
Rob
.
- Follow-Ups:
- Re: Using Crypt::DSA
- From: Mike Friedman
- Re: Using Crypt::DSA
- References:
- Using Crypt::DSA
- From: Mike Friedman
- Re: Using Crypt::DSA
- From: A. Sinan Unur
- Re: Using Crypt::DSA
- From: Mike Friedman
- Re: Using Crypt::DSA
- From: Sisyphus
- Re: Using Crypt::DSA
- From: Mike Friedman
- Re: Using Crypt::DSA
- From: Sisyphus
- Re: Using Crypt::DSA
- From: Mike Friedman
- Re: Using Crypt::DSA
- From: Sisyphus
- Re: Using Crypt::DSA
- From: Mike Friedman
- Using Crypt::DSA
- Prev by Date: MJD HOP influence
- Next by Date: Re: Making Datatypes Constant and Emulating Const Correctness
- Previous by thread: Re: Using Crypt::DSA
- Next by thread: Re: Using Crypt::DSA
- Index(es):