@majikah/majik-key 0.2.1 → 0.2.3

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.
@@ -7,6 +7,8 @@ export type SerializedMajikContact = {
7
7
  publicKeyBase64: string;
8
8
  mlKey: string;
9
9
  majikah_registered?: boolean;
10
+ edPublicKeyBase64?: string;
11
+ mlDsaPublicKeyBase64?: string;
10
12
  };
11
13
  export interface MajikContactMeta {
12
14
  label?: string;
@@ -24,6 +26,8 @@ export interface MajikContactData {
24
26
  mlKey: string;
25
27
  meta?: MajikContactMeta;
26
28
  majikah_registered?: boolean;
29
+ edPublicKeyBase64?: string;
30
+ mlDsaPublicKeyBase64?: string;
27
31
  }
28
32
  export interface MajikContactCard {
29
33
  id: string;
@@ -31,6 +35,8 @@ export interface MajikContactCard {
31
35
  fingerprint: string;
32
36
  label: string;
33
37
  mlKey: string;
38
+ edPublicKeyBase64?: string;
39
+ mlDsaPublicKeyBase64?: string;
34
40
  }
35
41
  export declare class MajikContactError extends Error {
36
42
  cause?: unknown;
@@ -43,6 +49,8 @@ export declare class MajikContact {
43
49
  };
44
50
  readonly fingerprint: string;
45
51
  readonly mlKey: string;
52
+ readonly edPublicKeyBase64: string;
53
+ readonly mlDsaPublicKeyBase64: string;
46
54
  meta: MajikContactMeta;
47
55
  private majikah_registered?;
48
56
  constructor(data: MajikContactData);
@@ -18,6 +18,8 @@ export class MajikContact {
18
18
  publicKey;
19
19
  fingerprint;
20
20
  mlKey;
21
+ edPublicKeyBase64;
22
+ mlDsaPublicKeyBase64;
21
23
  meta;
22
24
  majikah_registered;
23
25
  constructor(data) {
@@ -29,6 +31,8 @@ export class MajikContact {
29
31
  this.publicKey = data.publicKey;
30
32
  this.fingerprint = data.fingerprint;
31
33
  this.mlKey = data.mlKey;
34
+ this.edPublicKeyBase64 = data.edPublicKeyBase64 || "";
35
+ this.mlDsaPublicKeyBase64 = data.mlDsaPublicKeyBase64 || "";
32
36
  this.meta = {
33
37
  label: data.meta?.label || "",
34
38
  notes: data.meta?.notes || "",
@@ -152,6 +156,8 @@ export class MajikContact {
152
156
  publicKeyBase64: await this.getPublicKeyBase64(),
153
157
  majikah_registered: this.majikah_registered,
154
158
  mlKey: this.mlKey,
159
+ edPublicKeyBase64: this.edPublicKeyBase64,
160
+ mlDsaPublicKeyBase64: this.mlDsaPublicKeyBase64,
155
161
  };
156
162
  }
157
163
  /**
@@ -167,6 +173,8 @@ export class MajikContact {
167
173
  publicKey: { raw: publicKeyRaw },
168
174
  majikah_registered: serialized.majikah_registered,
169
175
  mlKey: serialized.mlKey,
176
+ edPublicKeyBase64: serialized.edPublicKeyBase64,
177
+ mlDsaPublicKeyBase64: serialized.mlDsaPublicKeyBase64,
170
178
  });
171
179
  }
172
180
  catch (err) {
@@ -85,6 +85,8 @@ export interface MajikKeyConstructorOptions {
85
85
  mlDsaPublicKey?: Uint8Array;
86
86
  encryptedMlDsaSecretKey?: ArrayBuffer;
87
87
  encryptedMlDsaSecretKeyBase64?: string;
88
+ edSecretKey?: Uint8Array;
89
+ mlDsaSecretKey?: Uint8Array;
88
90
  }
89
91
  export declare class MajikKey {
90
92
  private readonly _id;
package/dist/majik-key.js CHANGED
@@ -83,6 +83,8 @@ export class MajikKey {
83
83
  this._mlDsaPublicKey = options.mlDsaPublicKey;
84
84
  this._encryptedMlDsaSecretKey = options.encryptedMlDsaSecretKey;
85
85
  this._encryptedMlDsaSecretKeyBase64 = options.encryptedMlDsaSecretKeyBase64;
86
+ this._edSecretKey = options.edSecretKey;
87
+ this._mlDsaSecretKey = options.mlDsaSecretKey;
86
88
  }
87
89
  // ── Getters ─────────────────────────────────────────────────────────────────
88
90
  get id() {
@@ -184,6 +186,8 @@ export class MajikKey {
184
186
  mlDsaPublicKey: identity.mlDsaPublicKey,
185
187
  encryptedMlDsaSecretKey: identity.encryptedMlDsaSecretKey,
186
188
  encryptedMlDsaSecretKeyBase64: arrayBufferToBase64(identity.encryptedMlDsaSecretKey),
189
+ edSecretKey: identity.edSecretKey,
190
+ mlDsaSecretKey: identity.mlDsaSecretKey,
187
191
  });
188
192
  }
189
193
  catch (err) {
@@ -499,6 +503,12 @@ export class MajikKey {
499
503
  fingerprint: this._fingerprint,
500
504
  meta: { label: this._label },
501
505
  mlKey: mlKeyBase64,
506
+ edPublicKeyBase64: this._edPublicKey
507
+ ? arrayToBase64(this._edPublicKey)
508
+ : undefined,
509
+ mlDsaPublicKeyBase64: this._mlDsaPublicKey
510
+ ? arrayToBase64(this._mlDsaPublicKey)
511
+ : undefined,
502
512
  });
503
513
  }
504
514
  toKeyIdentity() {
@@ -602,6 +612,8 @@ export class MajikKey {
602
612
  mlDsaPublicKey: identity.mlDsaPublicKey,
603
613
  encryptedMlDsaSecretKey: identity.encryptedMlDsaSecretKey,
604
614
  encryptedMlDsaSecretKeyBase64: arrayBufferToBase64(identity.encryptedMlDsaSecretKey),
615
+ edSecretKey: identity.edSecretKey,
616
+ mlDsaSecretKey: identity.mlDsaSecretKey,
605
617
  });
606
618
  }
607
619
  catch (err) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-key",
3
3
  "type": "module",
4
4
  "description": "A post-quantum ready seed phrase account library for the Majikah ecosystem. Manages deterministic X25519 and ML-KEM-768 identities with Argon2id protection and seamless legacy account migration.",
5
- "version": "0.2.1",
5
+ "version": "0.2.3",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "@stablelib/pbkdf2": "^2.0.1",
57
57
  "@stablelib/sha256": "^2.0.1",
58
58
  "@stablelib/x25519": "^2.0.1",
59
- "@thezelijah/majik-user": "^1.0.3",
59
+ "@thezelijah/majik-user": "^1.0.6",
60
60
  "ed2curve": "^0.3.0",
61
61
  "hash-wasm": "^4.12.0"
62
62
  },