@pkistudio/dereditor
v0.1.4
Published
Standalone browser ASN.1 DER/BER/PEM viewer, editor, and reusable Core API.
Readme
DerEditor
DerEditor is a standalone browser-based ASN.1 DER/BER/PEM viewer and editor for the PkiStudio product family. It also provides a reusable CommonJS Core API.
It parses DER, BER, PEM, headerless base64, and hexadecimal input locally, displays ASN.1 data as a navigable tree, and supports inspecting, copying, exporting, editing, deleting, and reopening selected nodes. File contents remain in the browser; the Node.js service only serves static files.
Current version: 0.1.4
Use DerEditor online
Open DerEditor on GitHub Pages to use the current version from the default branch without installing anything.
Documents opened in the public application are parsed and edited locally in the browser. The Pages site serves only the static application files and does not receive or store the ASN.1 documents you open.
Independence
DerEditor contains its parser, serializer, encoder, viewer, OID resolver, and OID data in this repository. It has no runtime or development package dependencies and does not require another PkiStudio repository.
Wiki integration and social release announcements remain outside the repository. npm publication uses a separately confirmed manual workflow and never follows a GitHub Release automatically.
Features
- Browser-local DER, BER, PEM, headerless base64, and hexadecimal parsing.
- ASN.1 tree display with tag metadata, decoded values, OID names, and hexadecimal previews.
- Editing and DER re-encoding for supported primitive values.
- Node-level copy, export, delete, insert, add, and new-window actions.
- Reusable Core API for parsing, serializing, encoding, and inspecting ASN.1 data.
- Embeddable viewer API and bundled OID resolver.
Documentation
- User manual
- Developer guide
- Feature specification
- API specification
- GitHub prerequisites and Pages settings
- Release process
- npm publishing
Local development
DerEditor requires only Node.js; npm ci does not download application dependencies.
npm ci
npm test
npm run check
node app/server.jsThen open http://localhost:8080/.
Browser API
<div id="dereditor"></div>
<script src="dereditor-core.js" defer></script>
<script src="dereditor.js" defer></script>The viewer auto-initializes when #dereditor, [data-dereditor], or [data-dereditor-mount] exists. Disable auto-initialization with data-dereditor-auto-init="false" and initialize manually with window.DerEditor.init().
The Core API is available as window.DerEditorCore. The OID resolver script exposes window.DerEditorOidResolver.
The viewer delegates DER parsing, encoding, and shared ASN.1 value handling to the Core API. For script-tag use, load dereditor-core.js before dereditor.js as shown above. The CommonJS viewer entry point loads the Core module automatically and exposes the same instance as viewer.core.
Pass editable: false to DerEditor.init() to start the viewer in read-only mode. The returned instance can switch modes later with setEditable(false) or setEditable(true).
The DER inspector can edit an existing node's identifier class and tag index. Before applying an identifier change, it validates the current content against the selected universal tag.
Module API
The package manifest reserves the following local/self-reference entry points for future npm publication:
@pkistudio/dereditor: Core API.@pkistudio/dereditor/core: Core API alias.@pkistudio/dereditor/viewer: browser viewer API.@pkistudio/dereditor/oid-resolver: bundled OID resolver API.@pkistudio/dereditor/dereditor.ico: DerEditor application icon asset.@pkistudio/dereditor/pkistudio.ico: shared PkiStudio product-family icon asset.
const dereditor = require('@pkistudio/dereditor');
const document = dereditor.parseInput(
new Uint8Array([0x30, 0x03, 0x02, 0x01, 0x01])
);
console.log(dereditor.serializeTree(document.nodes));Resolve the DerEditor or shared PkiStudio icon from a CommonJS consumer with:
const dereditorIconPath = require.resolve('@pkistudio/dereditor/dereditor.ico');
const pkistudioIconPath = require.resolve('@pkistudio/dereditor/pkistudio.ico');Bundlers that support importing binary assets can use the same package subpaths as asset imports. The .ico files are assets and are not intended to be executed with require().
License
DerEditor is licensed under the MIT License. See LICENSE.
