I have been this project which involves sending of signed data.
I have been provided with a .pem file and a server certificate which I am supposed to import to another server from which I should sign the data using these files and then send over the signed data to another server for verification adn processing.
My Questions are:
- How do I import these two files into my server?
- How do I use perl to use the files to sign the data?
To note, I am to import into a linux (Suse).
This is what I have done so far I have added the .pem file to /etc/ssl I am using the below code to read from the .pem file then sign the data
my $rsa = new Crypt::RSA;
my $file = 'path to file';
my $key = new Crypt::RSA::Key::Private( Filename => $file , Password => "*****");
my $signature = $rsa->sign(Message => $data, Key => $key, Armour => 0);
I get errors when i try to run the script as below Bareword found where operator expected at (eval 30) line 4, near "/S2YUeaABL1sO3rk4HhjyDSMIJoc91n.....
I have noted that the contents of the .pem file has slashes within the file which is causing these problem. see sample
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCMdoWd+LEk22TMaEihLqwl8tJtuFzndJ8dTGrLw6twjfAeV0sg
PsDQbVu5/S2YUeaABL1sO3rk4HhjyDSMIJoc91nfE3kYueRxEA9eL5JlxPDg2Z3s