(PECL rnp >= 0.1.1)
rnp_op_generate_key — 生成密钥
说明
rnp_op_generate_key(
RnpFFI $ffi,
string $userid,
string $key_alg,
string $sub_alg = ?,
array $options = ?
): string|false
| Key | Data type | 说明 |
|---|---|---|
"bits" | integer | Primary key size in bits. Applicable only to RSA, DSA and El-Gamal keys. |
"hash" | string | Hash algorithm used in self signature or subkey binding signature. |
"dsa_qbits" | integer | Set size of a q parameter for DSA key. Note: appropriate default value will be set, depending on key bits. However you may override it if needed. |
"curve" | string | Set the curve used for ECC key. Note: this is only applicable for ECDSA, ECDH and SM2 keys. |
"request_password" | boolean | Enable requesting password via password provider. This password will be used for key encryption. Password provider callback function should be set in advance by calling rnp_ffi_set_pass_provider(). Note: this setting will be ignored if password was set via"password" |
"password" | string | Set the password used to encrypt the secret key data. |
"expiration" | integer | Set the key and subkey expiration time in seconds. |
"sub_bits" | integer | Subkey size in bits. Applicable only to RSA, DSA and El-Gamal keys. |
"sub_hash" | string | Hash algorithm used in subkey self signature or subkey binding signature. |
"sub_curve" | string | Set the curve used for ECC subkey. Note: this is only applicable for ECDSA, ECDH and SM2 keys. |