fix: Hack to force asn1.js

This commit is contained in:
Tom Hu
2021-07-19 08:39:55 -07:00
parent 5c832aefb8
commit fc5d663f82
40 changed files with 7010 additions and 3 deletions

23
dist/node_modules/asn1.js/lib/asn1/encoders/pem.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
'use strict';
const inherits = require('inherits');
const 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) {
const buf = DEREncoder.prototype.encode.call(this, data);
const p = buf.toString('base64');
const out = [ '-----BEGIN ' + options.label + '-----' ];
for (let i = 0; i < p.length; i += 64)
out.push(p.slice(i, i + 64));
out.push('-----END ' + options.label + '-----');
return out.join('\n');
};