Stefan,
The new_key_from_parameters method expects the parameters to be
Crypt::OpenSSL::Bignum objects. Judging from the Math::Pari man page,
you should be able to convert a Math::Pari bigint object $n to a
C::O::Bignum object by:
my $cob_n = Crypt::OpenSSL::Bignum->new_from_decimal($n->pari2pv());
You'll have to do this for each of the values; alternatively, you can do
it just for n and e, and let C::O::RSA compute the rest for you. This
latter approach will take a bit longer (in the millisecond range), but
if it's an infrequent operation, might be Good Enough For You.
- Ian
On Thu, 2004-05-20 at 14:22, Stefan Zasada wrote:
> Hi,
>
> I'm trying to load in a key from a file (using Crypt::Keys), and then use
> that key with OpenSSH::RSA. Im not sure if this is the best way to do it,
> but since Crypt::Keys gives you values for n, e, d, p and q I thought I
> could use these with new_key_from_parameters. When I tried it I got the
> error:
>
> `pointer_copy' is not a Pari function name at
> /home/M03/acs/zasadas/perl/lib/site_perl/5.8.3/i686-linux-thread-multi/Math/Pari.pm
> line 973.
>
> Is this a bug, or am I doing something wrong.
>
> Cheers,
>
> Stefan.
|