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.
In reply to Using Crypt::RSA for data signing in perl by shivam99aa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |