OpenSSL 函数
PHP Manual

openssl_pkey_new

(PHP 4 >= 4.2.0, PHP 5)

openssl_pkey_newGenerates a new private key

说明

resource openssl_pkey_new ([ array $configargs ] )

openssl_pkey_new() generates a new private and public key pair. The public component of the key can be obtained using openssl_pkey_get_public().

Note: 必须安装有有效的 openssl.cnf 以保证此函数正确运行. 参考 安装 的注释以获得更多信息.

参数

configargs

You can finetune the key generation (such as specifying the number of bits) using configargs. See openssl_csr_new() for more information about configargs.

返回值

Returns a resource identifier for the pkey on success, or FALSE on error.


OpenSSL 函数
PHP Manual