My head is completely blocked on this issue. I'm even shaking from desperation of this... Our government has surely made it extremely difficult to understand the law... Anyway, I'm drifting away, so back to the subject.

I have a key pair (.cer/.key - public/private), which was handed to me by the government.

I'm supposed to sign invoices with the private key, and even though they don't provide much detail, I kinda arrived at the conclusion I could use PHP for the work.

First, I need to create an MD5 hash of a string. Then I have to sign it with the public key, and then I need to convert the signature to base64.

The middle step I don't know how to do. It seems that the RSA PEAR package only accepts strings, so how could I convert my .key file so I can use it to sign my invoices?

I'll paypal $30 to the first person that helps me out.


Ivan V.