例子:
function main() {
    var rsa = new RSA();
    var key = rsa.genKey();
    console.log('key:' + key);
    var encodedData = rsa.encrypt('你好,世界!', key.publicKey);
    console.log('encodedData:' + encodedData);
    var decodedData = rsa.decrypt(encodedData, key.privateKey);
    console.log('decodedData:' + decodedData);
}
                | 参数名 | 类型 | 必填 | 说明 | 
|---|---|---|---|
| mode | string | 选填 | 工作模式,默认为'RSA',可以取值:'RSA/ECB/PKCS5Padding'等。 | 
| 参数名 | 类型 | 必填 | 说明 | 
|---|---|---|---|
| len | integer | 选填 | 长度,默认为128 | 
| 参数名 | 类型 | 必填 | 说明 | 
|---|---|---|---|
| data | string | 必填 | 待编码的数据 | 
| public key | string | 必填 | 公钥 | 
| 参数名 | 类型 | 必填 | 说明 | 
|---|---|---|---|
| data | string | 必填 | 编码后的数据 | 
| private key | string | 必填 | 私钥 |