@majikah/majik-message 0.2.10 → 0.2.12

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.
@@ -192,7 +192,7 @@ export class MajikContactDirectory {
192
192
  // Fallback: create a raw-key wrapper when the browser does not support the namedCurve
193
193
  publicKey = { raw: new Uint8Array(raw) };
194
194
  }
195
- const contact = MajikContact.create(item.id, publicKey, item.mlKey, item.fingerprint, item.meta);
195
+ const contact = MajikContact.create(item.id, publicKey, item.mlKey, item.fingerprint, item.meta, item.edPublicKeyBase64, item.mlDsaPublicKeyBase64);
196
196
  this.contacts.set(contact.id, contact);
197
197
  this.fingerprintMap.set(contact.fingerprint, contact.id);
198
198
  }
@@ -56,7 +56,7 @@ export declare class MajikContact {
56
56
  constructor(data: MajikContactData);
57
57
  static create(id: string, publicKey: CryptoKey | {
58
58
  raw: Uint8Array;
59
- }, mlKey: string, fingerprint: string, meta?: Partial<MajikContactMeta>): MajikContact;
59
+ }, mlKey: string, fingerprint: string, meta?: Partial<MajikContactMeta>, edPublicKeyBase64?: string, mlDsaPublicKeyBase64?: string): MajikContact;
60
60
  private assertId;
61
61
  private assertMLKey;
62
62
  private assertPublicKey;
@@ -41,13 +41,15 @@ export class MajikContact {
41
41
  updatedAt: data.meta?.updatedAt || new Date().toISOString(),
42
42
  };
43
43
  }
44
- static create(id, publicKey, mlKey, fingerprint, meta) {
44
+ static create(id, publicKey, mlKey, fingerprint, meta, edPublicKeyBase64, mlDsaPublicKeyBase64) {
45
45
  return new MajikContact({
46
46
  id,
47
47
  publicKey,
48
48
  fingerprint,
49
49
  meta,
50
50
  mlKey,
51
+ edPublicKeyBase64,
52
+ mlDsaPublicKeyBase64,
51
53
  });
52
54
  }
53
55
  assertId(id) {
@@ -328,6 +328,8 @@ export class MajikMessage {
328
328
  publicKey: publicKeyBase64,
329
329
  fingerprint: contact.fingerprint,
330
330
  mlKey: contact.mlKey,
331
+ edPublicKeyBase64: contact.edPublicKeyBase64,
332
+ mlDsaPublicKeyBase64: contact.mlDsaPublicKeyBase64,
331
333
  }, null, 2);
332
334
  }
333
335
  async exportContactAsString(contactId) {
@@ -357,6 +359,8 @@ export class MajikMessage {
357
359
  fingerprint: data.fingerprint,
358
360
  meta: { label: data.label },
359
361
  mlKey: data.mlKey,
362
+ edPublicKeyBase64: data.edPublicKeyBase64,
363
+ mlDsaPublicKeyBase64: data.mlDsaPublicKeyBase64,
360
364
  }));
361
365
  return { success: true, message: "Contact imported successfully" };
362
366
  }
@@ -397,6 +401,8 @@ export class MajikMessage {
397
401
  publicKey: publicKeyBase64,
398
402
  fingerprint: contact.fingerprint,
399
403
  mlKey: contact.mlKey,
404
+ edPublicKeyBase64: contact.edPublicKeyBase64,
405
+ mlDsaPublicKeyBase64: contact.mlDsaPublicKeyBase64,
400
406
  };
401
407
  const jsonStr = JSON.stringify(jsonObj);
402
408
  const utf8 = new TextEncoder().encode(jsonStr);
@@ -427,6 +433,8 @@ export class MajikMessage {
427
433
  fingerprint: data.fingerprint,
428
434
  meta: { label: data.label },
429
435
  mlKey: data.mlKey,
436
+ edPublicKeyBase64: data.edPublicKeyBase64,
437
+ mlDsaPublicKeyBase64: data.mlDsaPublicKeyBase64,
430
438
  });
431
439
  }
432
440
  addContact(contact) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-message",
3
3
  "type": "module",
4
4
  "description": "Post-quantum end-to-end encryption with ML-KEM-768. Seed phrase–based accounts. Auto-expiring messages. Offline-ready. Exportable encrypted messages. Tamper-proof threads with blockchain-like integrity. Quantum-resistant messaging.",
5
- "version": "0.2.10",
5
+ "version": "0.2.12",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",