PHP, Openssl and the private key

PHP, Openssl and the private key

Just as a side note, since I lately got some trouble passing the private key to the openssl_pkey_get_private() function. I was following a hint on the net but I did not succeed. The reason was a slight misunderstanding on my side: You can pass the private key to the function in two ways: Either a string containing the private key or a string containing location of the private key file on the harddisk. The latter one was the one I was struggling with. In case you want to use a file that contains the private key you need to pass the protocol identifier. If the protocol identifier is missing the function seems to think the string contains the private key, not the location of the private key. So, if you want to refer to the file /tmp/private.key the string needs to look this: file:///tmp/private.key


Eintrag von Stephan Hochdörfer am 08.08.2011

Tags: Allgemein, PHP

Diese Webseite verwendet Cookies, um die Bedienfreundlichkeit zu erhöhen. Mit der Nutzung unserer Webseite wird das Einverständnis erklärt, dass wir Cookies verwenden. Weitere Informationen.