qscl-nimo-sdk 0.2.0 → 0.2.1
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.
- package/README.md +18 -51
- package/dist/index.d.ts +2 -2
- package/dist/index.js +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,68 +1,35 @@
|
|
|
1
1
|
# QSCL SDK Developer Usage
|
|
2
2
|
|
|
3
|
-
The `qscl-sdk` natively transpiles from modern TypeScript into CommonJS strictly mapping to enterprise environments (Node.js/Next.js/etc). Below are the usage patterns for building a Quantum-Safe proxy application
|
|
3
|
+
The `qscl-nimo-sdk` natively transpiles from modern TypeScript into CommonJS strictly mapping to enterprise environments (Node.js/Next.js/etc). Below are the usage patterns for building a Quantum-Safe proxy application natively routing Post-Quantum Cryptography logic.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Clean Developer Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
const { QSCLClient } = require("qscl-sdk");
|
|
9
|
-
|
|
10
|
-
async function run() {
|
|
11
|
-
// 1. Initialize Client
|
|
12
|
-
const client = new QSCLClient({
|
|
13
|
-
baseURL: "http://localhost:8080",
|
|
14
|
-
apiKey: "your_admin_provisioned_api_key"
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// 2. Perform PQC Key Exchange & Session Pinning
|
|
18
|
-
await client.connect();
|
|
19
|
-
|
|
20
|
-
// 3. Fire Encrypted Traffic safely across proxy channels
|
|
21
|
-
const response = await client.secureFetch("/get", {
|
|
22
|
-
method: "POST",
|
|
23
|
-
body: JSON.stringify({ "secret": "quantum_payload" })
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// This decrypts the AES-GCM output entirely autonomously!
|
|
27
|
-
const data = await response.json();
|
|
28
|
-
console.log(data);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
run();
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## TypeScript Enterprise Flow
|
|
7
|
+
Replace ALL examples with:
|
|
35
8
|
|
|
36
9
|
```typescript
|
|
37
|
-
import { QSCLClient
|
|
10
|
+
import { QSCLClient } from "qscl-nimo-sdk";
|
|
11
|
+
|
|
12
|
+
const client = new QSCLClient({
|
|
13
|
+
baseURL: "http://localhost:8080",
|
|
14
|
+
apiKey: "YOUR_API_KEY"
|
|
15
|
+
});
|
|
38
16
|
|
|
39
|
-
|
|
40
|
-
const client = new QSCLClient({
|
|
41
|
-
baseURL: "https://pqc.my-enterprise-gateway.com",
|
|
42
|
-
apiKey: process.env.QSCL_TENANT_KEY!
|
|
43
|
-
// Advanced: Inject future Native C bindings via custom interfaces once WASM resolves
|
|
44
|
-
// customKEM: new WasmKyberKEM(),
|
|
45
|
-
// customSign: new WasmDilithiumSigner()
|
|
46
|
-
});
|
|
17
|
+
await client.connect();
|
|
47
18
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
headers: { "Content-Type": "application/json" },
|
|
54
|
-
body: JSON.stringify({ vault_id: 1234 })
|
|
55
|
-
});
|
|
19
|
+
const res = await client.secureFetch("/api/payment", {
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers: { "Content-Type": "application/json" },
|
|
22
|
+
body: JSON.stringify({ amount: 100 })
|
|
23
|
+
});
|
|
56
24
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
25
|
+
const data = await res.text();
|
|
26
|
+
console.log(data);
|
|
60
27
|
```
|
|
61
28
|
|
|
62
29
|
### SDK Transpiled Outputs:
|
|
63
30
|
Inside `/sdk/js/dist` you will see the NPM packaged bindings:
|
|
64
31
|
- `index.js`, `index.d.ts`
|
|
65
32
|
- `client.js`
|
|
66
|
-
- `crypto/
|
|
33
|
+
- `crypto/wasm/oqs.wasm`
|
|
67
34
|
- `transport.js`
|
|
68
35
|
- `session.js`
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./client";
|
|
2
2
|
export * from "./crypto/aes";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export { IKEMProvider } from "./crypto/kem";
|
|
4
|
+
export { ISignatureProvider } from "./crypto/sign";
|
|
5
5
|
export * from "./handshake";
|
|
6
6
|
export * from "./transport";
|
|
7
7
|
export * from "./session";
|
package/dist/index.js
CHANGED
|
@@ -17,8 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
// Central unified entry point cleanly resolving SDK paths for node resolution
|
|
18
18
|
__exportStar(require("./client"), exports);
|
|
19
19
|
__exportStar(require("./crypto/aes"), exports);
|
|
20
|
-
__exportStar(require("./crypto/kem"), exports);
|
|
21
|
-
__exportStar(require("./crypto/sign"), exports);
|
|
22
20
|
// Handshake definitions are accessible for advanced users defining specific intercept hooks
|
|
23
21
|
__exportStar(require("./handshake"), exports);
|
|
24
22
|
__exportStar(require("./transport"), exports);
|