VanillaJS, Lightweight, Zero-Dependency, PEM (RFC 7468) encoder and decoder.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
265 B

'use strict';
var PEM = module.exports;
var Enc = require('./node/native.js');
PEM.parseBlock = function(str) {
var der = str
.split(/\n/)
.filter(function(line) {
return !/-----/.test(line);
})
.join('');
return { bytes: Enc.base64ToBuf(der) };
};