BVB Source Codes

reactide Show pem.js Source code

Return Download reactide: download pem.js Source code - Download reactide Source code - Type:.js
  1. var inherits = require('inherits');
  2.  
  3. var DEREncoder = require('./der');
  4.  
  5. function PEMEncoder(entity) {
  6.   DEREncoder.call(this, entity);
  7.   this.enc = 'pem';
  8. };
  9. inherits(PEMEncoder, DEREncoder);
  10. module.exports = PEMEncoder;
  11.  
  12. PEMEncoder.prototype.encode = function encode(data, options) {
  13.   var buf = DEREncoder.prototype.encode.call(this, data);
  14.  
  15.   var p = buf.toString('base64');
  16.   var out = [ '-----BEGIN ' + options.label + '-----' ];
  17.   for (var i = 0; i < p.length; i += 64)
  18.     out.push(p.slice(i, i + 64));
  19.   out.push('-----END ' + options.label + '-----');
  20.   return out.join('\n');
  21. };
  22.  
downloadpem.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top