I'm generating a Public/Private key pair in PHP with the following:
<?php $config = array( "digest_alg" => "sha512", "private_key_bits" => 4096, "private_key_type" => OPENSSL_KEYTYPE_RSA, ); // Create the private and public key $res = openssl_pkey_new($config); // Extract the private key from $res to $privKey openssl_pkey_export($res, $privKey); // Extract the public key from $res to $pubKey $pubKey = openssl_pkey_get_details($res); ?>
But I'm doubting about what to choose for the
digest_alg variable. What is the 'best' to use here? Where can I choose from? And last but not least, what does it do?