OK, I'll bite. I am unsure if you are telling me that I need to include my entire chunk of code (cause clearly this is a fragment that won't compile on its own), or if there is some really obvious problem that I am just not seeing.
I have pulled my code out of the context I am using it, and have written a little bit of practise code to try to get this to work. The practise code still has the same error.
#!/usr/bin/perl
use strict;
use Crypt::RSA;
print "RSA tester\n";
my $infoToSign = "blah";
my $privateKey = 5;
my $rsa = new Crypt::RSA;
my $signatureValue = $rsa->sign(
Message => $infoToSign,
Key => $privateKey,);
I still get the same problem. I realise that my key in this example is not legitimate, but it should still work, right?
I might try generating a key using Crypt::RSA too. | [reply] [d/l] |
Crypt::RSA says the key argument is a "Private key of the sender, a Crypt::RSA::Key::Private(3) or compatible object." On the other hand, you're passing an unblessed scalar, which has no methods, rather than an object with the API Crypt::RSA expects.
You'll probably want to use something like $private = [doc://Crypt::RSA::Key::Private]->new(filename=>$private_key_file) to load the private key, and then pass that object along to sign().
| [reply] [d/l] [select] |