es.length; i++) {
        if (lines[i].trim().length > 0 && lines[i].indexOf('-----BEGIN') === -1 && lines[i].indexOf('-----END') === -1) {
            encoded += lines[i].trim();
        }
    }
    return encoded;
}
function base64ToPem(base64Key, type) {
    var pemHeader = '-----BEGIN ' + type + '-----\n';
    var pemFooter = '\n-----END ' + type + '-----\n';
    var chunkSize = 64;
    var base64KeyWithBreaks = base64Key.match(new RegExp('.{1,' + chunkSize + '}', 'g')).join('\n');
    var p