Hello Masters of Perl!
Solved! Special thanks to sundialsvc4
The truth is that i've never touched OpenSSL before so please have this in mind if you think I seem lost when it might be very obvious.
So, I'm gonna implement an integration to a webservice. Usually web services just concatenate parameters to string which is concatenated with a secret key and then this string with be used to create an MD5-hash. In this case the signature require a bit more security, or at least more complex way of making the signature.
The signature is made up by several concatenated parameters and other parameters and then the "tricky" parts come, OpenSSL signing and verification. I've made both the public and private key from the terminal as described in the documentation for the webservice. This is how far i made it. In the documentation there is an example in which PHP is used. The methods which is used are: openssl_get_privatekey, openssl_get_publickey, openssl_sign, openssl_verify.
So, I need to find methods from a module in Perl that does the same thing as the PHP-function does.
I searched around for modules and the one I found the best documentation for was Crypt::OpenSSL::RSA.
The documentation have an example which I tested a bit before I ended up here.
I need your help to get trough this part.
Can someone here explain how I can use Crypt::OpenSSL:RSA or another module that does the same task as the four functions I mentioned above?
I need to read in the private key first, which I'm calling private.pem in the same way that PHP does it: openssl_get_privatekey(file_get_contents(private.pem)). file_get_contents just reads in the hole file to a string and returns it. I don't need help with reading in a file to a string, that's a no-brainer. But where do I go from here ?
The second part is to use a similar function to PHP:s openssl_sign.
The third part is to use a similar function to PHP:s openssl_get_publickey
And last, the forth and final step, openssl_verify.
I don't have any code that I can bring to the table due that fact I don't have anything helpful at the moment.
Best regards,
Martin
In reply to Crypt::OpenSSL:RSA Questions by martin87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |