@gjsify/tls-native 0.4.43 → 0.4.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +43 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @gjsify/tls-native
2
+
3
+ Optional native Vala + C bridge for advanced TLS capabilities on GJS that are not exposed by `Gio.TlsConnection`: OCSP response parsing (RFC 6960) via GnuTLS, TLS session resumption data (`getSession` / `setSession`), and channel binding (`tls-unique`, `tls-exporter`) for SCRAM-SHA-* authentication. Consumed by `@gjsify/tls` to back `TLSSocket.getFinished()`, `getPeerFinished()`, `getSession()`, and OCSP stapling support.
4
+
5
+ Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
6
+
7
+ ## Installation
8
+
9
+ This package is loaded automatically by `@gjsify/tls` when present. Install it to enable OCSP parsing and session access in your GJS TLS code:
10
+
11
+ ```bash
12
+ gjsify install @gjsify/tls-native
13
+
14
+ # npm or yarn also work:
15
+ npm install @gjsify/tls-native
16
+ yarn add @gjsify/tls-native
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```typescript
22
+ // Loaded automatically by @gjsify/tls.
23
+ // For direct OCSP parsing:
24
+ import {
25
+ hasNativeTls,
26
+ parseOcspResponse,
27
+ OcspCertStatus,
28
+ } from '@gjsify/tls-native';
29
+
30
+ if (hasNativeTls()) {
31
+ // derBytes: Uint8Array containing a DER-encoded OCSPResponse
32
+ const info = parseOcspResponse(derBytes);
33
+ if (info && info.certStatus === OcspCertStatus.GOOD) {
34
+ console.log('certificate is valid');
35
+ }
36
+ }
37
+ ```
38
+
39
+ Ships as a prebuilt `.so` + `.typelib` for `linux-x86_64`. Requires `glib-networking` with a GnuTLS backend (the default on Fedora / GNOME platforms).
40
+
41
+ ## License
42
+
43
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/tls-native",
3
- "version": "0.4.43",
3
+ "version": "0.4.44",
4
4
  "description": "Optional Vala/GObject bridge providing GnuTLS capabilities not exposed by Gio.TlsConnection — OCSP-response parsing (RFC 6960), session resumption data extraction, channel binding (tls-finished bytes for SCRAM-SHA-*). Enhances @gjsify/tls when installed.",
5
5
  "type": "module",
6
6
  "main": "lib/esm/index.js",
@@ -59,8 +59,8 @@
59
59
  "@girs/gobject-2.0": "2.88.0-4.0.4"
60
60
  },
61
61
  "devDependencies": {
62
- "@gjsify/cli": "^0.4.43",
63
- "@gjsify/unit": "^0.4.43",
62
+ "@gjsify/cli": "^0.4.44",
63
+ "@gjsify/unit": "^0.4.44",
64
64
  "@ts-for-gir/cli": "^4.0.4",
65
65
  "@types/node": "^25.9.1",
66
66
  "typescript": "^6.0.3"