$dn = array( "countryName" => "CN", "stateOrProvinceName" => "SX", "localityName" => "TY", "organizationName" => "The ltd", "organizationalUnitName" => "PHP U", "commonName" => "PHP", "emailAddress" => "[email protected]");$configargs = array( 'config' => 'G:/php/openssl.cnf', 'digest_alg' => 'md5', 'x509_extensions' => 'v3_ca', 'req_extensions' => 'v3_req', 'private_key_bits' => 666, 'private_key_type' => OPENSSL_KEYTYPE_RSA, 'encrypt_key' => true, );//根据configargs生成公钥/私钥对
$res = openssl_pkey_new($configargs);
$d=openssl_pkey_export($res, $privkey);
var_dump($d);
var_dump($privkey);
// Get public key
$pubkey=openssl_pkey_get_details($res);
$pubkey=$pubkey["key"];现在的问题是 pubkey可以生成 prikey却生成不了,$d总显示为false;哪位高手帮忙看看私钥怎么生成opensslPHPRSA