Skip to content

Editing and Interaction

dweller long gone edited this page May 21, 2026 · 1 revision

Editing and Interaction

PkiStudioJS displays ASN.1 structures as expandable tree nodes. Users can inspect, edit, insert, delete, copy, export, and reopen selected nodes.

Tree Display

The viewer displays:

  • ASN.1 tag names and tag numbers.
  • Universal, Application, Context-specific, and Private classes.
  • Primitive and constructed encoding.
  • Header length, value range, and value length.
  • Decoded values for common universal types.
  • Compact hexadecimal value previews.
  • OID names loaded from oids.json when available.
  • Nested constructed values as expandable tree nodes.
  • BER indefinite-length constructed values as TAG (Indefinite).
  • Derived EndOfContent (0) terminators.
  • Encapsulated DER inside supported BIT STRING and OCTET STRING values.

Tree Context Menu

Click a tree item icon to open its context menu.

Menu order:

  • Edit
  • Insert before
  • Add
  • Delete
  • Send to

Add appears only for structured nodes.

Inspecting and Editing

Edit opens the DER inspector for the selected node. The inspector shows identifier details, class, method, tag index, length, tag name, and a hexadecimal content preview.

PkiStudioJS can edit primitive nodes and then re-encode the DER tree. Constructed nodes such as SEQUENCE and SET are inspectable but not edited directly. Their length mode can be switched between definite and indefinite in the DER inspector.

The DER inspector can also edit an existing node's identifier class and tag index. Before applying an identifier change, PkiStudioJS validates the current content against the selected universal tag.

Editable Value Types

Editable text-like values include:

  • UTF8String
  • NumericString
  • PrintableString
  • TeletexString
  • IA5String
  • UTCTime
  • GeneralizedTime
  • BMPString

Specialized primitive editors include:

  • OBJECT IDENTIFIER: edited in dotted decimal form, such as 1.2.840.113549.
  • OCTET STRING: edited as hexadecimal bytes.
  • BIT STRING: edited as hexadecimal bytes plus the Unused bits value.

Time values have a dedicated editor with date, time, GMT/local zone selection, and numeric offset fields. DER time format validation is applied before updating the node.

Primitive nodes without a specialized editor are edited as raw hexadecimal value bytes. Binary value editors can also load replacement bytes from a local file.

Edited values are validated, re-encoded, reparsed, and displayed immediately.

Insert and Add

Insert before creates a sibling immediately before the selected node.

Actions:

  • New Item: creates a new empty OCTET STRING sibling.
  • from Clipboard as HEX Text: reads compact DER hexadecimal text, parses it as exactly one ASN.1 element, and inserts it before the selected node.

Add creates a child under the selected structured node.

Actions:

  • New Item: creates a new empty OCTET STRING child.
  • from Clipboard as HEX Text: reads compact DER hexadecimal text, parses it as exactly one ASN.1 element, and adds it under the selected node.

Delete

Delete removes the selected node from the current document and re-encodes the remaining tree.

Derived EndOfContent (0) terminators are controlled by their parent indefinite-length setting and cannot be deleted directly.

Send To

The Send to submenu exports or reopens a selected node.

Actions:

  • New Window: opens the selected node and its subtree in a new browser window.
  • New Window as Extracted: appears only when the node contains encapsulated DER.
  • Clipboard as Tree Text: copies the selected node as indented tree text.
  • Clipboard as HEX Text: copies the selected node as compact DER hexadecimal text.

New-window actions transfer DER bytes through browser localStorage and add temporary query parameters to the new window URL. Transfer data and temporary theme parameters are removed after they are read.

Validation and Clipboard Behavior

The parser enforces DER/BER constraints such as valid length boundaries, high-tag-number decoding, matching EndOfContent terminators for indefinite-length values, and matching re-encoded bytes.

Clipboard reads require a browser context that permits the Clipboard API. In most browsers this means HTTPS or localhost. Clipboard writes use the Clipboard API when available and fall back to a browser copy command when possible.

Clone this wiki locally