GenerateKeyPair: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Shared function}} {{Added feature/item|1.6.0|1.5.9|21055|This function creates a new public key and private key for encrypting data}} {{Needs Example}} Category:Incomplete ==Syntax== <syntaxhighlight lang="lua"> string, string GenerateKeyPair ( string algorithm, table options [, function callback ] ) </syntaxhighlight> ===Required Arguments=== *'''algorithm:''' The algorithm to use: ** ''RSA'': use the RSA public-key algorithm *'''options:''' table...") |
(No difference)
|
Revision as of 09:26, 19 August 2022
This function creates a new public key and private key for encrypting data
Script Example Missing Function GenerateKeyPair needs a script example, help out by writing one. | |
Before submitting check out Editing Guidelines Script Examples. |
Syntax
string, string GenerateKeyPair ( string algorithm, table options [, function callback ] )
Required Arguments
- algorithm: The algorithm to use:
- RSA: use the RSA public-key algorithm
- options: table with options for the hashing algorithm, as detailed below.
Optional Arguments
- callback: providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.
Options for each hashing algorithm
- RSA:
- size (int), default: 0 . Size of a key.
Returns
Returns 2 strings if successful: private key and public key. Otherwise returns false