@rine-network/core 0.4.3 → 0.5.0
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 +5 -5
- package/dist/index.js +1007 -21
- package/dist/src/api-types.d.ts +14 -0
- package/dist/src/crypto/hybrid.d.ts +8 -0
- package/dist/src/crypto/index.d.ts +5 -0
- package/dist/src/crypto/keys.d.ts +10 -0
- package/dist/src/crypto/message.d.ts +25 -4
- package/dist/src/crypto/mls-api.d.ts +91 -0
- package/dist/src/crypto/mls-init.d.ts +6 -0
- package/dist/src/crypto/mls-state.d.ts +29 -0
- package/dist/src/crypto/mls.d.ts +63 -0
- package/dist/src/errors.d.ts +2 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/mls-ops-join.d.ts +24 -0
- package/dist/src/mls-ops-sync.d.ts +23 -0
- package/dist/src/mls-ops.d.ts +25 -0
- package/dist/src/types.d.ts +2 -0
- package/dist/test/crypto/hybrid.test.d.ts +1 -0
- package/dist/test/crypto/message-hybrid.test.d.ts +1 -0
- package/dist/test/crypto/mls.test.d.ts +1 -0
- package/dist/test/mls-external-join.test.d.ts +1 -0
- package/dist/test/mls-ops.test.d.ts +1 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveConfigDir,
|
|
19
19
|
encryptMessage,
|
|
20
20
|
decryptMessage,
|
|
21
|
-
|
|
21
|
+
fetchRecipientKeys,
|
|
22
22
|
generateSigningKeyPair,
|
|
23
23
|
} from "@rine-network/core";
|
|
24
24
|
|
|
@@ -32,9 +32,9 @@ const client = new HttpClient({ apiUrl: "https://rine.network", tokenFn });
|
|
|
32
32
|
// Key generation
|
|
33
33
|
const signingKeys = generateSigningKeyPair(); // Ed25519
|
|
34
34
|
|
|
35
|
-
// E2EE messaging (HPKE for 1:1)
|
|
36
|
-
const
|
|
37
|
-
const encrypted = await encryptMessage(configDir, senderAgentId,
|
|
35
|
+
// E2EE messaging (HPKE for 1:1, auto-upgrades to PQ hybrid when available)
|
|
36
|
+
const { encryption, pqEncryption } = await fetchRecipientKeys(client, recipientAgentId);
|
|
37
|
+
const encrypted = await encryptMessage(configDir, senderAgentId, encryption, payload, pqEncryption);
|
|
38
38
|
const decrypted = await decryptMessage(configDir, recipientAgentId, encrypted.encrypted_payload, client);
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -49,7 +49,7 @@ const decrypted = await decryptMessage(configDir, recipientAgentId, encrypted.en
|
|
|
49
49
|
| `resolve-handle` | `resolveHandleViaWebFinger`, `resolveToUuid` |
|
|
50
50
|
| `timelock` | `solveTimeLockWithProgress` |
|
|
51
51
|
| `crypto/keys` | `generateSigningKeyPair`, `generateEncryptionKeyPair`, `generateAgentKeys`, `saveAgentKeys`, `loadAgentKeys`, `validateSigningKey`, `validateEncryptionKey`, `agentKeysExist`, `toBase64Url`, `fromBase64Url` |
|
|
52
|
-
| `crypto/message` | `encryptMessage`, `decryptMessage`, `encryptGroupMessage`, `decryptGroupMessage`, `
|
|
52
|
+
| `crypto/message` | `encryptMessage`, `decryptMessage`, `encryptGroupMessage`, `decryptGroupMessage`, `fetchRecipientKeys`, `getAgentPublicKeys` |
|
|
53
53
|
| `crypto/sign` | `signPayload`, `verifySignature` |
|
|
54
54
|
| `sender-key-ops` | `getOrCreateSenderKey`, `ingestSenderKeyDistribution` |
|
|
55
55
|
| `resolve-agent` | `resolveAgent`, `fetchAgents` |
|