Generates the RSA encryption keys. This method is a prerequisite for the remaining methods.
Both the publicKey
and privateKey
are
generated using either the DER or the PEM
encoding.
For details on certificate encoding standards, please refer to the SSL Knowledgebase.
Name | Description | Type | Use |
---|---|---|---|
keySize | Defines the size of the resulting key (i.e. encryption strength), expressed in bits. A valid value must be the multiple of 1024. |
integer
|
required |
keyFormat | Defines the format of the encryption key:
|
string
|
required |
callback | Passed to inform of the results the key generation process. |
object
|
required |
The callback may be structured as follows:
{ onFailure: function(error) { ... }, onSuccess: function({publicKey, privateKey}) { ... } }
Name | Description | Return type |
---|---|---|
onFailure | Indicates that the encryption key generation failed. | undefined |
onSuccess | Indicates that the generation process succesfully completed. Passes the two RSA keys:
publicKey and privateKey encrypted using
either the DER or the PEM encoding. |
undefined |