PHP: openssl_pkey_new()

Note to self: When generating a new private key using openssl_pkey_new(), and specifying the private_key_bits parameter as a variable. Be sure to cast the variable to an integer! e.g. $keysize = "2048"; $privateKey = openssl_pkey_new(array( 'private_key_bits' => $keysize, // --->…