vesko Posted December 20, 2012 Share Posted December 20, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/272219-unable-to-sign-anything-with-openssl_pkcs7_sign/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 20, 2012 Share Posted December 20, 2012 We cannot possibly help you with something you tried without the exact code you used, sample data that you used, and the specific error you got for that code and data. Quote Link to comment https://forums.phpfreaks.com/topic/272219-unable-to-sign-anything-with-openssl_pkcs7_sign/#findComment-1400588 Share on other sites More sharing options...
vesko Posted December 20, 2012 Author Share Posted December 20, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/272219-unable-to-sign-anything-with-openssl_pkcs7_sign/#findComment-1400621 Share on other sites More sharing options...
Christian F. Posted December 20, 2012 Share Posted December 20, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/272219-unable-to-sign-anything-with-openssl_pkcs7_sign/#findComment-1400648 Share on other sites More sharing options...
PFMaBiSmAd Posted December 20, 2012 Share Posted December 20, 2012 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... Quote Link to comment https://forums.phpfreaks.com/topic/272219-unable-to-sign-anything-with-openssl_pkcs7_sign/#findComment-1400652 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.