@indrajala/asn1der
Version:
parse ASN.1 DER structures
29 lines • 1.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
require("mocha");
const __1 = require("..");
const hex = '3081f10201020a01010201030a01010408dd4490c65d7f3b3504003056bf853d080206017596adf018bf85454604443042311c301a04157a612e636f2e696e6472616a616c612e666c756964020101312204207b6d3688d13ef0b621464e05dc712a4c62e34707388a52aeb61c35238da94f14307fa1083106020102020103a203020101a30402020800a5053103020106a6053103020103bf8148050203010001bf8377020500bf853e03020100bf853f020500bf85402a30280420dfc2920c81e136fdd2a510478fda137b262dc51d449edd7d0bdb554745725cfe0101ff0a0100bf85410502030186a0bf8542050203031519';
describe('Asn1Node', () => {
const node = __1.parseDER(Buffer.from(hex, 'hex'))[0];
it('getSetElements yields the child elements', () => {
const setNode = node.get('7.0.0');
chai_1.expect(true)
.to
.equal(true);
});
it('getNULL works correctly when the null node is present', () => {
// console.log(node.get('7.#503.0').toString());
// console.log(node.get('7.#503').identifier);
chai_1.expect(node.get('7.#503.0').getNull())
.to
.equal(true);
});
it('getNULL works correctly when the null node is not present', () => {
var _a, _b;
chai_1.expect((_b = (_a = node.get('7.#504.0')) === null || _a === void 0 ? void 0 : _a.getNull()) !== null && _b !== void 0 ? _b : false)
.to
.equal(false);
});
});
//# sourceMappingURL=asn1node.spec.js.map