I was this project, which includes sending signed data.
I am provided with a .pem file and a server certificate, which I must import to another server from which I must sign the data using these files, and then send the signed data to another server for verification and processing.
My questions:
- How to import these two files to my server?
- How to use perl to use files for data signing?
To note, I have to import into Linux (Suse).
This is what I have done so far. I added the .pem file to / etc / ssl. I use the code below to read from the .pem file and 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 a script, as shown below A bug was found where the operator was expecting in line (eval 30) 4, next to "/ S2YUeaABL1sO3rk4HhjyDSMIJoc91n .....
I noticed that the contents of the .pem file has slashes in the file that causes this problem. see sample
source share