How can I create a .pem file?

How can I create a .pem file for this zend? I used code below but still invalid. please advice.

// Create the keypair
$res=openssl_pkey_new();
// Get private key
openssl_pkey_export($res, $privkey, “blah” );
print($privkey)
$pubkey=openssl_pkey_get_details($res);
$pubkey=$pubkey[“key”];
print($pubkey);

exit;

If you can’t find the pem you should have an openssl crt+key already generated on your server.
Combine them (terminal/bash) to make a pem:

cat /path/to/server.crt /path/to/server.key > server.pem

Or (again bash) create a PEM for the server:

openssl req -x509 -newkey rsa:2048 -keyout /path/of/private.pem -out /path/of/public.pem -days 365

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.