shivam99aa has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to sign my message with my SSH private key which is in ~/.ssh/id_rsa. But on using Crypt::RSA for signing i keep getting error. Code used by me is
use strict; use warnings; use Crypt::RSA; my $rsa = new Crypt::RSA ( ES => 'PKCS1v15' ); my $pkey = new Crypt::RSA::Key::Private ( Filename => '/home/abc/.ssh +/id_rsa' ); print $pkey;
The error is of this type
Number found where operator expected at (eval 21) line 6, near "ZapzlA +9gZ8 23" (Missing semicolon on previous line?) Bareword found where operator expected at (eval 21) line 6, near "23mq +j2RsKOF0Lal7YbjYFkDE7YrLPktf0FNNYvn6BjKZDlyQfpWnk8dP3crjoown" (Missing operator before mqj2RsKOF0Lal7YbjYFkDE7YrLPktf0FNNYvn6BjK +ZDlyQfpWnk8dP3crjoown?) Number found where operator expected at (eval 21) line 9, near "QUgHQA +J4R 34" (Missing semicolon on previous line?) Bareword found where operator expected at (eval 21) line 9, near "34Cs +y0lcx" (Missing operator before Csy0lcx?) Having no space between pattern and following word is deprecated at (e +val 21) line 10.
there are more messages like the one above and then at last line i get
Can't use an undefined value as a HASH reference at /usr/local/share/perl/5.14.2/Crypt/RSA/Key/Private.pm line 217.I also want to mention here that i also tried using Crpyt::RSA::Key::Private::SSH but i am not able to get the syntax correct, thus not able to understand if this is solution or not. Not much is given on cpan on how to use it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Crypt::RSA for data signing in perl
by Mr. Muskrat (Canon) on Dec 04, 2014 at 19:30 UTC | |
by shivam99aa (Novice) on Dec 07, 2014 at 09:10 UTC | |
by Mr. Muskrat (Canon) on Dec 08, 2014 at 17:00 UTC | |
|
Re: Using Crypt::RSA for data signing in perl
by Anonymous Monk on Dec 04, 2014 at 07:29 UTC | |
by shivam99aa (Novice) on Dec 04, 2014 at 07:34 UTC | |
by wrog (Friar) on Dec 04, 2014 at 07:43 UTC | |
by shivam99aa (Novice) on Dec 04, 2014 at 08:32 UTC | |
|
Re: Using Crypt::RSA for data signing in perl
by Anonymous Monk on Dec 04, 2014 at 15:11 UTC |