generateKeys


Purpose

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.

Note

For details on certificate encoding standards, please refer to the SSL Knowledgebase.

Signature

encryption.RSA.generateKeys ( keySize, keyFormat, callback)

Returns

This method does not return anything.

Parameters

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:

  • DER_FORMAT denotes that the DER (Base-64 encoded) format should be used

  • PEM_FORMAT denotes that the PEM format should be used

string required
callback Passed to inform of the results the key generation process. object required

Callback structure

The callback may be structured as follows:

{
	onFailure: function(error) { ... },
	onSuccess: function({publicKey, privateKey}) { ... }
}

Methods

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

Related topics

Overview
Legal notice | Copyright © 2015 and Confidential to Pegasystems Inc. All rights reserved. | Feedback
Advanced...