openssl_pkey_export

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Gets an exportable representation of a key into a string
openssl_pkey_export(¬†¬†¬†¬†OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $key,¬†¬†¬†¬†string &$output,¬†¬†¬†¬†?string $passphrase null,¬†¬†¬†¬†?array $options null): bool
echo $out;



$passphrase = isset($argv[2]) ? $argv[2] : null;

openssl_pkey_export($privkey$out$passphrase);

echo 
$out;