Sha256: 0a4f1922e7b133bbba7a428000f48a5291668f73dd50f45077f61d53c50365c9
Contents?: true
Size: 590 Bytes
Versions: 28
Compression:
Stored size: 590 Bytes
Contents
var inherits = require('inherits'); var DEREncoder = require('./der'); function PEMEncoder(entity) { DEREncoder.call(this, entity); this.enc = 'pem'; }; inherits(PEMEncoder, DEREncoder); module.exports = PEMEncoder; PEMEncoder.prototype.encode = function encode(data, options) { var buf = DEREncoder.prototype.encode.call(this, data); var p = buf.toString('base64'); var out = [ '-----BEGIN ' + options.label + '-----' ]; for (var i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64)); out.push('-----END ' + options.label + '-----'); return out.join('\n'); };
Version data entries
28 entries across 28 versions & 11 rubygems