Jump to content

Recommended Posts

Hi,

 

Im trying to sign a text file with openssl_pkcs7_sign, but Im getting nowhere.

No matter what I do I get "error getting private key" or "error getting cert". Im trying this with a Thawte certificate and a self issued one (following this http://www.akadia.com/services/ssh_test_certificate.html).

I have tried with 'file://' in the path and without also with and without a password on the key.

I have tried on three different php versions (all from the php 5.3 branch) and to me it seems the function is broken.

Does anyone has a working piece with this function? On what php version does it work?

 

Thanks for looking

Hi,

 

Actually I did provide the exact errors I get - namely "error getting private key" and "error getting cert". I didnt ask either someone to debug my code but instead to post a sample code if he/she has a working piece (and the php version if possible).

 

Thank you

Debugging your code is implied in the title for this section:

Do you need help with some code you wrote? Ask here! We'll get you the answers!

 

In any case, if we disregard the error messages (which you may or may not have given in their entirety) and the code (which you didn't provide) that's still only 2 out of 4 items requested by PFMaBiSmAd. All of which he requested so that he would be able to help you out with your problem, without having to waste time trying to guess what you've done.

Since this thread isn't about getting help with what was causing your code to not work, moving thread to the appropriate forum section...

 

Programming does not involve trying things and throwing them away until you write, find, or are given 'correct' code. It involves learning the meaning of what you are doing and when there is an error or an unexpected result, to determine what is causing it and fixing the problem. There's at least a half-dozen different things that could cause any particular error and any code someone posts could produce that/those same error messages for a reason wholly different from what was causing them for the code/data you tried.

 

Around 99.2% of the problems using any programming language are due to a lack of understanding. The other .8% are actual bugs. You need to debug why your code didn't work, so that you actually learn, over expecting someone to hand you a working example, that probably won't work on your server, with your certificate, where it is located on your server, with the permissions it has set for it...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.