I wonder if PHP's OpenSSL extension can be used to generate private/public key/certificate pairs?
Sure, use openssl_pkey_new
:
$privateKey = openssl_pkey_new(array('private_key_bits' => 2048));
$details = openssl_pkey_get_details($privateKey);
$publicKey = $details['key'];
You can export the keys with openssl_pkey_export
or openssl_pkey_export_to_file
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With