-
Notifications
You must be signed in to change notification settings - Fork 0
Embedding
dweller long gone edited this page May 23, 2026
·
1 revision
The standalone viewer can be mounted in a browser page or Webview host through @pkistudio/asn1defsifter/app.
import { initAsn1DefinitionSifter } from '@pkistudio/asn1defsifter/app';
import '@pkistudio/asn1defsifter/styles.css';
const app = initAsn1DefinitionSifter({
mount: '#app',
theme: 'dark'
});
await app.loadHex('300d06092a864886f70d01010b0500', 'algorithm-identifier.hex');Important options include:
-
mount: selector or element where the app should render. -
theme:lightordark. -
viewer.oidResolver: custom OID resolver or resolver callback for the embedded PkiStudioJS viewer. -
viewer.newWindowUrl: URL used when PkiStudioJS opens selected DER in a standalone viewer tab.
The initializer returns an app instance with:
-
report: current candidate report ornull. -
sourceName: current source name ornull. -
loadBytes(bytes, sourceName?). -
loadHex(hex, sourceName?). -
close().
The viewer is browser-first and host-neutral. Hosts remain responsible for:
- choosing where to mount the app,
- serving
index.htmlandviewer.htmlif needed, - wiring Webview lifecycle outside the package,
- deciding whether to persist input or copied report JSON,
- configuring any host-specific file access or dialogs.
The reusable resolver core does not depend on DOM, VS Code APIs, or host file systems.
Use the Core API directly when you need a headless workflow:
- batch analysis,
- serverless browser logic,
- VS Code extension commands,
- AI agent tools,
- tests or smoke checks.
Use the browser app when users need a visible PkiStudioJS-backed inspection surface.