This function generates a GnuPG (GPG) key. The system saves the key in the user's .gnupg
directory.
Note:
This function uses the system's entropy to generate the key. Systems with low entropy levels may cause long generation times or timeouts.
email required | string The user's email address. Example: |
name required | string The name of the user for whom to generate the key. Example: |
passphrase required | string Default: The key's password. Example: |
comment | string Default: A comment about the key. Example: |
expire | string The desired expiration date of the key as a timestamp in Unix time format. Note: This will default to one year from the current date. Example: |
keysize | integer Default: The new key's size, in bytes. Note: Large keys require more time to generate. Example: |
no | integer Default: Whether to generate the key without an expiration date.
Example: |
HTTP Request was successful.
apiversion | integer The version of the API. |
func | string The name of the method called. |
module | string The name of the module called. |
object |
uapi --output=jsonpretty \ --user=username \ GPG \ generate_key \ name='username' \ email='user@example.com' passphrase='123456luggage'
{- "apiversion": 3,
- "func": "generate_key",
- "module": "GPG",
- "result": {
- "data": null,
- "errors": null,
- "messages": null,
- "metadata": { },
- "status": 1,
- "warnings": null
}
}