Skip to content

Getting Started

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

Getting Started

Private Key Gadgets can be used as a local browser app, a reusable npm package, or an embeddable Webview-friendly UI.

Install from npm

npm install @pkistudio/pvkgadgets

The package exports:

  • @pkistudio/pvkgadgets: UI-independent Core API.
  • @pkistudio/pvkgadgets/core: Core API alias.
  • @pkistudio/pvkgadgets/pkcs12: PKCS#12 helper API.
  • @pkistudio/pvkgadgets/app: browser application initializer.
  • @pkistudio/pvkgadgets/styles.css: application stylesheet.

Run Locally from the Repository

npm install
npm run dev

Then open the Vite local URL, normally:

http://localhost:5173/

In VS Code, the Start pvkgadgets server task starts the same development server on port 5173.

Generate a Key Pair

Use the New menu in the left pane to generate a browser-supported key pair. Supported families depend on the current browser WebCrypto implementation and may include RSA, EC, Ed25519, and X25519.

Generated key pairs appear as top-level tree items. Each generated key pair contains DER-backed child objects such as PrivateKey and PublicKey.

Import PKCS#12

Use Open to load .p12 or .pfx files.

Private Key Gadgets detects PKCS#12 input and prompts for the password when needed. Imported key material is added to the key tree. Matching certificates are attached under the imported key pair.

Non-PKCS#12 ASN.1 DER or PEM data is routed to the embedded PkiStudioJS viewer.

Create SubjectDN, CSR, and Certificate Objects

Common workflow:

  1. Generate or import a key pair.
  2. Use the key pair menu to create a SubjectDN item.
  3. Select the PrivateKey item and create a CSR or self-signed certificate.
  4. Inspect generated DER in the embedded ASN.1 viewer.

SubjectDN input uses LDAP-style order, for example:

CN=example.com, O=Example, C=JP

CSR and self-signed certificate creation support RSA and EC signing keys and SHA-256, SHA-384, or SHA-512 signing choices.

Export Key Material

Use Save to export selected top-level key pairs as password-protected PKCS#12 files.

Individual DER objects are displayed in the embedded PkiStudioJS viewer. Use the viewer Save menu when you want to write the currently displayed DER document to a file.

Clone this wiki locally