internxt-crypto 0.0.11 → 0.0.14
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/dist/{symmetric-crypto-CrdS1Che.mjs → aes-DCb9dJqb.mjs} +10 -46
- package/dist/aes-DCb9dJqb.mjs.map +1 -0
- package/dist/{symmetric-crypto-D65zB396.js → aes-DQo1MyCz.js} +13 -54
- package/dist/aes-DQo1MyCz.js.map +1 -0
- package/dist/asymmetric-crypto.d.mts +1 -4
- package/dist/asymmetric-crypto.d.mts.map +1 -0
- package/dist/asymmetric-crypto.d.ts +1 -4
- package/dist/asymmetric-crypto.d.ts.map +1 -0
- package/dist/asymmetric-crypto.js +8 -7
- package/dist/asymmetric-crypto.mjs +1 -1
- package/dist/{chunk-DWirmd9C.mjs → chunk-DQk6qfdC.mjs} +3 -3
- package/dist/{chunk-Dt-PWiN7.js → chunk-EbLFQX5m.js} +3 -3
- package/dist/constants.d.mts +5 -5
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.d.ts +5 -5
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +63 -30
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +33 -2
- package/dist/constants.mjs.map +1 -0
- package/dist/derive-key.d.mts +1 -4
- package/dist/derive-key.d.mts.map +1 -0
- package/dist/derive-key.d.ts +1 -4
- package/dist/derive-key.d.ts.map +1 -0
- package/dist/derive-key.js +12 -14
- package/dist/derive-key.mjs +1 -4
- package/dist/{derive-key-CBf2WxJd.js → deriveKeysFromPassword-BYaiSGKL.js} +26 -52
- package/dist/deriveKeysFromPassword-BYaiSGKL.js.map +1 -0
- package/dist/{derive-key-Be7hS-cN.mjs → deriveKeysFromPassword-XIwzErlL.mjs} +7 -28
- package/dist/deriveKeysFromPassword-XIwzErlL.mjs.map +1 -0
- package/dist/email-crypto.d.mts +2 -5
- package/dist/email-crypto.d.mts.map +1 -0
- package/dist/email-crypto.d.ts +2 -5
- package/dist/email-crypto.d.ts.map +1 -0
- package/dist/email-crypto.js +12 -16
- package/dist/email-crypto.mjs +1 -6
- package/dist/email-search.d.mts +20 -23
- package/dist/email-search.d.mts.map +1 -0
- package/dist/email-search.d.ts +20 -23
- package/dist/email-search.d.ts.map +1 -0
- package/dist/email-search.js +25 -63
- package/dist/email-search.js.map +1 -1
- package/dist/email-search.mjs +17 -51
- package/dist/email-search.mjs.map +1 -1
- package/dist/{keystore-crypto-Bjgriq9h.mjs → emailEncryptionKey-B9xHw1h_.mjs} +12 -21
- package/dist/emailEncryptionKey-B9xHw1h_.mjs.map +1 -0
- package/dist/{keystore-crypto-B4yCVo9l.js → emailEncryptionKey-CQNe5W_T.js} +25 -40
- package/dist/emailEncryptionKey-CQNe5W_T.js.map +1 -0
- package/dist/{email-crypto-BrT98taw.js → emailKeys-C0KhtfNP.js} +67 -112
- package/dist/emailKeys-C0KhtfNP.js.map +1 -0
- package/dist/{email-crypto-DJUEjTxA.mjs → emailKeys-D4lp9NRv.mjs} +29 -75
- package/dist/emailKeys-D4lp9NRv.mjs.map +1 -0
- package/dist/{utils-DS04iUcX.mjs → genID-3Er5IowC.mjs} +4 -24
- package/dist/genID-3Er5IowC.mjs.map +1 -0
- package/dist/{utils-CNs3cyDj.js → genID-YJSl3YhL.js} +6 -31
- package/dist/genID-YJSl3YhL.js.map +1 -0
- package/dist/hash.d.mts +1 -4
- package/dist/hash.d.mts.map +1 -0
- package/dist/hash.d.ts +1 -4
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +11 -10
- package/dist/hash.mjs +1 -1
- package/dist/index.d.mts +19 -39
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +19 -39
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -88
- package/dist/index.mjs +12 -14
- package/dist/{asymmetric-crypto-CyXsV4XT.mjs → keys-BfcaiAOv.mjs} +3 -15
- package/dist/keys-BfcaiAOv.mjs.map +1 -0
- package/dist/{asymmetric-crypto-BORmLhnx.js → keys-CinT7kEY.js} +2 -20
- package/dist/keys-CinT7kEY.js.map +1 -0
- package/dist/keystore-crypto.d.mts +2 -5
- package/dist/keystore-crypto.d.mts.map +1 -0
- package/dist/keystore-crypto.d.ts +2 -5
- package/dist/keystore-crypto.d.ts.map +1 -0
- package/dist/keystore-crypto.js +5 -10
- package/dist/keystore-crypto.mjs +1 -7
- package/dist/kyber768-SXnIo-Nw.mjs +47 -0
- package/dist/kyber768-SXnIo-Nw.mjs.map +1 -0
- package/dist/kyber768-WUVc2fIR.js +65 -0
- package/dist/kyber768-WUVc2fIR.js.map +1 -0
- package/dist/{hash-BoqwNkcd.js → mac-BMb1F0dN.js} +3 -23
- package/dist/mac-BMb1F0dN.js.map +1 -0
- package/dist/{hash-CXeGAwai.mjs → mac-ZpRlx8Fs.mjs} +3 -18
- package/dist/mac-ZpRlx8Fs.mjs.map +1 -0
- package/dist/post-quantum-crypto.d.mts +32 -2
- package/dist/post-quantum-crypto.d.mts.map +1 -0
- package/dist/post-quantum-crypto.d.ts +32 -2
- package/dist/post-quantum-crypto.d.ts.map +1 -0
- package/dist/post-quantum-crypto.js +5 -16
- package/dist/post-quantum-crypto.mjs +2 -2
- package/dist/storage-service.d.mts +47 -2
- package/dist/storage-service.d.mts.map +1 -0
- package/dist/storage-service.d.ts +47 -2
- package/dist/storage-service.d.ts.map +1 -0
- package/dist/storage-service.js +58 -4
- package/dist/storage-service.js.map +1 -0
- package/dist/storage-service.mjs +55 -2
- package/dist/storage-service.mjs.map +1 -0
- package/dist/symmetric-crypto.d.mts +5 -8
- package/dist/symmetric-crypto.d.mts.map +1 -0
- package/dist/symmetric-crypto.d.ts +5 -8
- package/dist/symmetric-crypto.d.ts.map +1 -0
- package/dist/symmetric-crypto.js +9 -9
- package/dist/symmetric-crypto.mjs +1 -2
- package/dist/types.d.mts +108 -2
- package/dist/types.d.mts.map +1 -0
- package/dist/types.d.ts +108 -2
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -2
- package/dist/types.js.map +1 -0
- package/dist/types.mjs +9 -2
- package/dist/types.mjs.map +1 -0
- package/dist/utils.d.mts +2 -5
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.d.ts +2 -5
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +16 -15
- package/dist/utils.mjs +1 -1
- package/package.json +24 -14
- package/dist/asymmetric-crypto-BORmLhnx.js.map +0 -1
- package/dist/asymmetric-crypto-CyXsV4XT.mjs.map +0 -1
- package/dist/constants-Ccp21E03.js +0 -208
- package/dist/constants-Ccp21E03.js.map +0 -1
- package/dist/constants-kTeX-2T0.mjs +0 -34
- package/dist/constants-kTeX-2T0.mjs.map +0 -1
- package/dist/derive-key-Be7hS-cN.mjs.map +0 -1
- package/dist/derive-key-CBf2WxJd.js.map +0 -1
- package/dist/email-crypto-BrT98taw.js.map +0 -1
- package/dist/email-crypto-DJUEjTxA.mjs.map +0 -1
- package/dist/hash-BoqwNkcd.js.map +0 -1
- package/dist/hash-CXeGAwai.mjs.map +0 -1
- package/dist/index-CQqgKsbX.d.ts +0 -50
- package/dist/index-CintVUbp.d.ts +0 -97
- package/dist/index-D5pBU_A5.d.mts +0 -50
- package/dist/index-MaOov-ag.d.mts +0 -97
- package/dist/keystore-crypto-B4yCVo9l.js.map +0 -1
- package/dist/keystore-crypto-Bjgriq9h.mjs.map +0 -1
- package/dist/keystore-service.d.mts +0 -48
- package/dist/keystore-service.d.ts +0 -48
- package/dist/keystore-service.js +0 -122
- package/dist/keystore-service.js.map +0 -1
- package/dist/keystore-service.mjs +0 -114
- package/dist/keystore-service.mjs.map +0 -1
- package/dist/post-quantum-crypto-CAi-cEkV.js +0 -189
- package/dist/post-quantum-crypto-CAi-cEkV.js.map +0 -1
- package/dist/post-quantum-crypto-Vv34t6gX.mjs +0 -154
- package/dist/post-quantum-crypto-Vv34t6gX.mjs.map +0 -1
- package/dist/storage-service-BgIK2aYZ.js +0 -82
- package/dist/storage-service-BgIK2aYZ.js.map +0 -1
- package/dist/storage-service-CubCbhY2.mjs +0 -65
- package/dist/storage-service-CubCbhY2.mjs.map +0 -1
- package/dist/symmetric-crypto-CrdS1Che.mjs.map +0 -1
- package/dist/symmetric-crypto-D65zB396.js.map +0 -1
- package/dist/types-52g887Zi.js +0 -16
- package/dist/types-52g887Zi.js.map +0 -1
- package/dist/types-BiEoleqw.mjs +0 -10
- package/dist/types-BiEoleqw.mjs.map +0 -1
- package/dist/types-Ds3ivE9W.d.ts +0 -104
- package/dist/types-DwQJtrTx.d.mts +0 -104
- package/dist/utils-CNs3cyDj.js.map +0 -1
- package/dist/utils-DS04iUcX.mjs.map +0 -1
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
type EncryptedKeystore = {
|
|
3
|
+
userEmail: string;
|
|
4
|
+
type: KeystoreType;
|
|
5
|
+
encryptedKeys: EmailKeysEncrypted;
|
|
6
|
+
};
|
|
7
|
+
type User = {
|
|
8
|
+
email: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
type UserWithPublicKeys = User & {
|
|
12
|
+
publicKeys: PublicKeys;
|
|
13
|
+
};
|
|
14
|
+
type PublicKeys = {
|
|
15
|
+
eccPublicKey: CryptoKey;
|
|
16
|
+
kyberPublicKey: Uint8Array;
|
|
17
|
+
};
|
|
18
|
+
type PublicKeysBase64 = {
|
|
19
|
+
eccPublicKeyBase64: string;
|
|
20
|
+
kyberPublicKeyBase64: string;
|
|
21
|
+
};
|
|
22
|
+
type HybridKeyPair = {
|
|
23
|
+
publicKey: Uint8Array;
|
|
24
|
+
secretKey: Uint8Array;
|
|
25
|
+
};
|
|
26
|
+
type PrivateKeys = {
|
|
27
|
+
eccPrivateKey: CryptoKey;
|
|
28
|
+
kyberPrivateKey: Uint8Array;
|
|
29
|
+
};
|
|
30
|
+
type PrivateKeysEncrypted = {
|
|
31
|
+
eccPrivateKeyBase64: string;
|
|
32
|
+
kyberPrivateKeyBase64: string;
|
|
33
|
+
};
|
|
34
|
+
type EmailKeys = {
|
|
35
|
+
publicKeys: PublicKeys;
|
|
36
|
+
privateKeys: PrivateKeys;
|
|
37
|
+
};
|
|
38
|
+
type EmailKeysEncrypted = {
|
|
39
|
+
publicKeys: PublicKeysBase64;
|
|
40
|
+
privateKeys: PrivateKeysEncrypted;
|
|
41
|
+
};
|
|
42
|
+
type HybridEncryptedEmail = {
|
|
43
|
+
encryptedKey: HybridEncKey;
|
|
44
|
+
enc: EmailBodyEncrypted;
|
|
45
|
+
recipientEmail: string;
|
|
46
|
+
params: EmailPublicParameters;
|
|
47
|
+
id: string;
|
|
48
|
+
isSubjectEncrypted: boolean;
|
|
49
|
+
};
|
|
50
|
+
type PwdProtectedEmail = {
|
|
51
|
+
encryptedKey: PwdProtectedKey;
|
|
52
|
+
enc: EmailBodyEncrypted;
|
|
53
|
+
params: EmailPublicParameters;
|
|
54
|
+
id: string;
|
|
55
|
+
isSubjectEncrypted: boolean;
|
|
56
|
+
};
|
|
57
|
+
type StoredEmail = {
|
|
58
|
+
params: EmailPublicParameters;
|
|
59
|
+
enc: EmailBodyEncrypted;
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
type HybridEncKey = {
|
|
63
|
+
kyberCiphertext: string;
|
|
64
|
+
encryptedKey: string;
|
|
65
|
+
};
|
|
66
|
+
type PwdProtectedKey = {
|
|
67
|
+
encryptedKey: string;
|
|
68
|
+
salt: string;
|
|
69
|
+
};
|
|
70
|
+
type EmailBodyEncrypted = {
|
|
71
|
+
encText: string;
|
|
72
|
+
encAttachments?: string[];
|
|
73
|
+
};
|
|
74
|
+
type EmailBody = {
|
|
75
|
+
text: string;
|
|
76
|
+
attachments?: string[];
|
|
77
|
+
};
|
|
78
|
+
type EmailPublicParameters = {
|
|
79
|
+
subject: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
sender: User;
|
|
82
|
+
recipient: User;
|
|
83
|
+
recipients?: User[];
|
|
84
|
+
replyToEmailID?: string;
|
|
85
|
+
labels?: string[];
|
|
86
|
+
};
|
|
87
|
+
type Email = {
|
|
88
|
+
id: string;
|
|
89
|
+
body: EmailBody;
|
|
90
|
+
params: EmailPublicParameters;
|
|
91
|
+
};
|
|
92
|
+
interface MailCache<Email> {
|
|
93
|
+
esCache: Map<string, Email>;
|
|
94
|
+
cacheSize: number;
|
|
95
|
+
isCacheLimited: boolean;
|
|
96
|
+
isCacheReady: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface EmailSearchResult {
|
|
99
|
+
email: Email;
|
|
100
|
+
score?: number;
|
|
101
|
+
}
|
|
102
|
+
declare enum KeystoreType {
|
|
103
|
+
ENCRYPTION = "Encryption",
|
|
104
|
+
RECOVERY = "Recovery"
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { Email, EmailBody, EmailBodyEncrypted, EmailKeys, EmailKeysEncrypted, EmailPublicParameters, EmailSearchResult, EncryptedKeystore, HybridEncKey, HybridEncryptedEmail, HybridKeyPair, KeystoreType, MailCache, PrivateKeys, PrivateKeysEncrypted, PublicKeys, PublicKeysBase64, PwdProtectedEmail, PwdProtectedKey, StoredEmail, User, UserWithPublicKeys };
|
|
108
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";KAAY,iBAAA;EACV,SAAA;EACA,IAAA,EAAM,YAAA;EACN,aAAA,EAAe,kBAAA;AAAA;AAAA,KAGL,IAAA;EACV,KAAA;EACA,IAAA;AAAA;AAAA,KAGU,kBAAA,GAAqB,IAAA;EAC/B,UAAA,EAAY,UAAA;AAAA;AAAA,KAGF,UAAA;EACV,YAAA,EAAc,SAAA;EACd,cAAA,EAAgB,UAAA;AAAA;AAAA,KAGN,gBAAA;EACV,kBAAA;EACA,oBAAA;AAAA;AAAA,KAGU,aAAA;EACV,SAAA,EAAW,UAAA;EACX,SAAA,EAAW,UAAA;AAAA;AAAA,KAGD,WAAA;EACV,aAAA,EAAe,SAAA;EACf,eAAA,EAAiB,UAAA;AAAA;AAAA,KAGP,oBAAA;EACV,mBAAA;EACA,qBAAA;AAAA;AAAA,KAGU,SAAA;EACV,UAAA,EAAY,UAAA;EACZ,WAAA,EAAa,WAAA;AAAA;AAAA,KAGH,kBAAA;EACV,UAAA,EAAY,gBAAA;EACZ,WAAA,EAAa,oBAAA;AAAA;AAAA,KAGH,oBAAA;EACV,YAAA,EAAc,YAAA;EACd,GAAA,EAAK,kBAAA;EACL,cAAA;EACA,MAAA,EAAQ,qBAAA;EACR,EAAA;EACA,kBAAA;AAAA;AAAA,KAGU,iBAAA;EACV,YAAA,EAAc,eAAA;EACd,GAAA,EAAK,kBAAA;EACL,MAAA,EAAQ,qBAAA;EACR,EAAA;EACA,kBAAA;AAAA;AAAA,KAGU,WAAA;EACV,MAAA,EAAQ,qBAAA;EACR,GAAA,EAAK,kBAAA;EACL,EAAA;AAAA;AAAA,KAGU,YAAA;EACV,eAAA;EACA,YAAA;AAAA;AAAA,KAGU,eAAA;EACV,YAAA;EACA,IAAA;AAAA;AAAA,KAGU,kBAAA;EACV,OAAA;EACA,cAAA;AAAA;AAAA,KAGU,SAAA;EACV,IAAA;EACA,WAAA;AAAA;AAAA,KAGU,qBAAA;EACV,OAAA;EACA,SAAA;EACA,MAAA,EAAQ,IAAA;EACR,SAAA,EAAW,IAAA;EACX,UAAA,GAAa,IAAA;EACb,cAAA;EACA,MAAA;AAAA;AAAA,KAGU,KAAA;EACV,EAAA;EACA,IAAA,EAAM,SAAA;EACN,MAAA,EAAQ,qBAAA;AAAA;AAAA,UAGO,SAAA;EACf,OAAA,EAAS,GAAA,SAAY,KAAA;EACrB,SAAA;EACA,cAAA;EACA,YAAA;AAAA;AAAA,UAEe,iBAAA;EACf,KAAA,EAAO,KAAA;EACP,KAAA;AAAA;AAAA,aAGU,YAAA;EACV,UAAA;EACA,QAAA;AAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
type EncryptedKeystore = {
|
|
3
|
+
userEmail: string;
|
|
4
|
+
type: KeystoreType;
|
|
5
|
+
encryptedKeys: EmailKeysEncrypted;
|
|
6
|
+
};
|
|
7
|
+
type User = {
|
|
8
|
+
email: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
type UserWithPublicKeys = User & {
|
|
12
|
+
publicKeys: PublicKeys;
|
|
13
|
+
};
|
|
14
|
+
type PublicKeys = {
|
|
15
|
+
eccPublicKey: CryptoKey;
|
|
16
|
+
kyberPublicKey: Uint8Array;
|
|
17
|
+
};
|
|
18
|
+
type PublicKeysBase64 = {
|
|
19
|
+
eccPublicKeyBase64: string;
|
|
20
|
+
kyberPublicKeyBase64: string;
|
|
21
|
+
};
|
|
22
|
+
type HybridKeyPair = {
|
|
23
|
+
publicKey: Uint8Array;
|
|
24
|
+
secretKey: Uint8Array;
|
|
25
|
+
};
|
|
26
|
+
type PrivateKeys = {
|
|
27
|
+
eccPrivateKey: CryptoKey;
|
|
28
|
+
kyberPrivateKey: Uint8Array;
|
|
29
|
+
};
|
|
30
|
+
type PrivateKeysEncrypted = {
|
|
31
|
+
eccPrivateKeyBase64: string;
|
|
32
|
+
kyberPrivateKeyBase64: string;
|
|
33
|
+
};
|
|
34
|
+
type EmailKeys = {
|
|
35
|
+
publicKeys: PublicKeys;
|
|
36
|
+
privateKeys: PrivateKeys;
|
|
37
|
+
};
|
|
38
|
+
type EmailKeysEncrypted = {
|
|
39
|
+
publicKeys: PublicKeysBase64;
|
|
40
|
+
privateKeys: PrivateKeysEncrypted;
|
|
41
|
+
};
|
|
42
|
+
type HybridEncryptedEmail = {
|
|
43
|
+
encryptedKey: HybridEncKey;
|
|
44
|
+
enc: EmailBodyEncrypted;
|
|
45
|
+
recipientEmail: string;
|
|
46
|
+
params: EmailPublicParameters;
|
|
47
|
+
id: string;
|
|
48
|
+
isSubjectEncrypted: boolean;
|
|
49
|
+
};
|
|
50
|
+
type PwdProtectedEmail = {
|
|
51
|
+
encryptedKey: PwdProtectedKey;
|
|
52
|
+
enc: EmailBodyEncrypted;
|
|
53
|
+
params: EmailPublicParameters;
|
|
54
|
+
id: string;
|
|
55
|
+
isSubjectEncrypted: boolean;
|
|
56
|
+
};
|
|
57
|
+
type StoredEmail = {
|
|
58
|
+
params: EmailPublicParameters;
|
|
59
|
+
enc: EmailBodyEncrypted;
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
type HybridEncKey = {
|
|
63
|
+
kyberCiphertext: string;
|
|
64
|
+
encryptedKey: string;
|
|
65
|
+
};
|
|
66
|
+
type PwdProtectedKey = {
|
|
67
|
+
encryptedKey: string;
|
|
68
|
+
salt: string;
|
|
69
|
+
};
|
|
70
|
+
type EmailBodyEncrypted = {
|
|
71
|
+
encText: string;
|
|
72
|
+
encAttachments?: string[];
|
|
73
|
+
};
|
|
74
|
+
type EmailBody = {
|
|
75
|
+
text: string;
|
|
76
|
+
attachments?: string[];
|
|
77
|
+
};
|
|
78
|
+
type EmailPublicParameters = {
|
|
79
|
+
subject: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
sender: User;
|
|
82
|
+
recipient: User;
|
|
83
|
+
recipients?: User[];
|
|
84
|
+
replyToEmailID?: string;
|
|
85
|
+
labels?: string[];
|
|
86
|
+
};
|
|
87
|
+
type Email = {
|
|
88
|
+
id: string;
|
|
89
|
+
body: EmailBody;
|
|
90
|
+
params: EmailPublicParameters;
|
|
91
|
+
};
|
|
92
|
+
interface MailCache<Email> {
|
|
93
|
+
esCache: Map<string, Email>;
|
|
94
|
+
cacheSize: number;
|
|
95
|
+
isCacheLimited: boolean;
|
|
96
|
+
isCacheReady: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface EmailSearchResult {
|
|
99
|
+
email: Email;
|
|
100
|
+
score?: number;
|
|
101
|
+
}
|
|
102
|
+
declare enum KeystoreType {
|
|
103
|
+
ENCRYPTION = "Encryption",
|
|
104
|
+
RECOVERY = "Recovery"
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { Email, EmailBody, EmailBodyEncrypted, EmailKeys, EmailKeysEncrypted, EmailPublicParameters, EmailSearchResult, EncryptedKeystore, HybridEncKey, HybridEncryptedEmail, HybridKeyPair, KeystoreType, MailCache, PrivateKeys, PrivateKeysEncrypted, PublicKeys, PublicKeysBase64, PwdProtectedEmail, PwdProtectedKey, StoredEmail, User, UserWithPublicKeys };
|
|
108
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";KAAY,iBAAA;EACV,SAAA;EACA,IAAA,EAAM,YAAA;EACN,aAAA,EAAe,kBAAA;AAAA;AAAA,KAGL,IAAA;EACV,KAAA;EACA,IAAA;AAAA;AAAA,KAGU,kBAAA,GAAqB,IAAA;EAC/B,UAAA,EAAY,UAAA;AAAA;AAAA,KAGF,UAAA;EACV,YAAA,EAAc,SAAA;EACd,cAAA,EAAgB,UAAA;AAAA;AAAA,KAGN,gBAAA;EACV,kBAAA;EACA,oBAAA;AAAA;AAAA,KAGU,aAAA;EACV,SAAA,EAAW,UAAA;EACX,SAAA,EAAW,UAAA;AAAA;AAAA,KAGD,WAAA;EACV,aAAA,EAAe,SAAA;EACf,eAAA,EAAiB,UAAA;AAAA;AAAA,KAGP,oBAAA;EACV,mBAAA;EACA,qBAAA;AAAA;AAAA,KAGU,SAAA;EACV,UAAA,EAAY,UAAA;EACZ,WAAA,EAAa,WAAA;AAAA;AAAA,KAGH,kBAAA;EACV,UAAA,EAAY,gBAAA;EACZ,WAAA,EAAa,oBAAA;AAAA;AAAA,KAGH,oBAAA;EACV,YAAA,EAAc,YAAA;EACd,GAAA,EAAK,kBAAA;EACL,cAAA;EACA,MAAA,EAAQ,qBAAA;EACR,EAAA;EACA,kBAAA;AAAA;AAAA,KAGU,iBAAA;EACV,YAAA,EAAc,eAAA;EACd,GAAA,EAAK,kBAAA;EACL,MAAA,EAAQ,qBAAA;EACR,EAAA;EACA,kBAAA;AAAA;AAAA,KAGU,WAAA;EACV,MAAA,EAAQ,qBAAA;EACR,GAAA,EAAK,kBAAA;EACL,EAAA;AAAA;AAAA,KAGU,YAAA;EACV,eAAA;EACA,YAAA;AAAA;AAAA,KAGU,eAAA;EACV,YAAA;EACA,IAAA;AAAA;AAAA,KAGU,kBAAA;EACV,OAAA;EACA,cAAA;AAAA;AAAA,KAGU,SAAA;EACV,IAAA;EACA,WAAA;AAAA;AAAA,KAGU,qBAAA;EACV,OAAA;EACA,SAAA;EACA,MAAA,EAAQ,IAAA;EACR,SAAA,EAAW,IAAA;EACX,UAAA,GAAa,IAAA;EACb,cAAA;EACA,MAAA;AAAA;AAAA,KAGU,KAAA;EACV,EAAA;EACA,IAAA,EAAM,SAAA;EACN,MAAA,EAAQ,qBAAA;AAAA;AAAA,UAGO,SAAA;EACf,OAAA,EAAS,GAAA,SAAY,KAAA;EACrB,SAAA;EACA,cAAA;EACA,YAAA;AAAA;AAAA,UAEe,iBAAA;EACf,KAAA,EAAO,KAAA;EACP,KAAA;AAAA;AAAA,aAGU,YAAA;EACV,UAAA;EACA,QAAA;AAAA"}
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
//#region src/types.ts
|
|
4
|
+
let KeystoreType = /* @__PURE__ */ function(KeystoreType) {
|
|
5
|
+
KeystoreType["ENCRYPTION"] = "Encryption";
|
|
6
|
+
KeystoreType["RECOVERY"] = "Recovery";
|
|
7
|
+
return KeystoreType;
|
|
8
|
+
}({});
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.KeystoreType = KeystoreType;
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["export type EncryptedKeystore = {\n userEmail: string;\n type: KeystoreType;\n encryptedKeys: EmailKeysEncrypted;\n};\n\nexport type User = {\n email: string;\n name: string;\n};\n\nexport type UserWithPublicKeys = User & {\n publicKeys: PublicKeys;\n};\n\nexport type PublicKeys = {\n eccPublicKey: CryptoKey;\n kyberPublicKey: Uint8Array;\n};\n\nexport type PublicKeysBase64 = {\n eccPublicKeyBase64: string;\n kyberPublicKeyBase64: string;\n};\n\nexport type HybridKeyPair = {\n publicKey: Uint8Array;\n secretKey: Uint8Array;\n};\n\nexport type PrivateKeys = {\n eccPrivateKey: CryptoKey;\n kyberPrivateKey: Uint8Array;\n};\n\nexport type PrivateKeysEncrypted = {\n eccPrivateKeyBase64: string;\n kyberPrivateKeyBase64: string;\n};\n\nexport type EmailKeys = {\n publicKeys: PublicKeys;\n privateKeys: PrivateKeys;\n};\n\nexport type EmailKeysEncrypted = {\n publicKeys: PublicKeysBase64;\n privateKeys: PrivateKeysEncrypted;\n};\n\nexport type HybridEncryptedEmail = {\n encryptedKey: HybridEncKey;\n enc: EmailBodyEncrypted;\n recipientEmail: string;\n params: EmailPublicParameters;\n id: string;\n isSubjectEncrypted: boolean;\n};\n\nexport type PwdProtectedEmail = {\n encryptedKey: PwdProtectedKey;\n enc: EmailBodyEncrypted;\n params: EmailPublicParameters;\n id: string;\n isSubjectEncrypted: boolean;\n};\n\nexport type StoredEmail = {\n params: EmailPublicParameters;\n enc: EmailBodyEncrypted;\n id: string;\n};\n\nexport type HybridEncKey = {\n kyberCiphertext: string;\n encryptedKey: string;\n};\n\nexport type PwdProtectedKey = {\n encryptedKey: string;\n salt: string;\n};\n\nexport type EmailBodyEncrypted = {\n encText: string;\n encAttachments?: string[];\n};\n\nexport type EmailBody = {\n text: string;\n attachments?: string[];\n};\n\nexport type EmailPublicParameters = {\n subject: string;\n createdAt: string;\n sender: User;\n recipient: User;\n recipients?: User[];\n replyToEmailID?: string;\n labels?: string[];\n};\n\nexport type Email = {\n id: string;\n body: EmailBody;\n params: EmailPublicParameters;\n};\n\nexport interface MailCache<Email> {\n esCache: Map<string, Email>;\n cacheSize: number;\n isCacheLimited: boolean;\n isCacheReady: boolean;\n}\nexport interface EmailSearchResult {\n email: Email;\n score?: number;\n}\n\nexport enum KeystoreType {\n ENCRYPTION = 'Encryption',\n RECOVERY = 'Recovery',\n}\n"],"mappings":";;;AAwHA,IAAY,sDAAL;AACL;AACA"}
|
package/dist/types.mjs
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/types.ts
|
|
2
|
+
let KeystoreType = /* @__PURE__ */ function(KeystoreType) {
|
|
3
|
+
KeystoreType["ENCRYPTION"] = "Encryption";
|
|
4
|
+
KeystoreType["RECOVERY"] = "Recovery";
|
|
5
|
+
return KeystoreType;
|
|
6
|
+
}({});
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
export { KeystoreType };
|
|
10
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["export type EncryptedKeystore = {\n userEmail: string;\n type: KeystoreType;\n encryptedKeys: EmailKeysEncrypted;\n};\n\nexport type User = {\n email: string;\n name: string;\n};\n\nexport type UserWithPublicKeys = User & {\n publicKeys: PublicKeys;\n};\n\nexport type PublicKeys = {\n eccPublicKey: CryptoKey;\n kyberPublicKey: Uint8Array;\n};\n\nexport type PublicKeysBase64 = {\n eccPublicKeyBase64: string;\n kyberPublicKeyBase64: string;\n};\n\nexport type HybridKeyPair = {\n publicKey: Uint8Array;\n secretKey: Uint8Array;\n};\n\nexport type PrivateKeys = {\n eccPrivateKey: CryptoKey;\n kyberPrivateKey: Uint8Array;\n};\n\nexport type PrivateKeysEncrypted = {\n eccPrivateKeyBase64: string;\n kyberPrivateKeyBase64: string;\n};\n\nexport type EmailKeys = {\n publicKeys: PublicKeys;\n privateKeys: PrivateKeys;\n};\n\nexport type EmailKeysEncrypted = {\n publicKeys: PublicKeysBase64;\n privateKeys: PrivateKeysEncrypted;\n};\n\nexport type HybridEncryptedEmail = {\n encryptedKey: HybridEncKey;\n enc: EmailBodyEncrypted;\n recipientEmail: string;\n params: EmailPublicParameters;\n id: string;\n isSubjectEncrypted: boolean;\n};\n\nexport type PwdProtectedEmail = {\n encryptedKey: PwdProtectedKey;\n enc: EmailBodyEncrypted;\n params: EmailPublicParameters;\n id: string;\n isSubjectEncrypted: boolean;\n};\n\nexport type StoredEmail = {\n params: EmailPublicParameters;\n enc: EmailBodyEncrypted;\n id: string;\n};\n\nexport type HybridEncKey = {\n kyberCiphertext: string;\n encryptedKey: string;\n};\n\nexport type PwdProtectedKey = {\n encryptedKey: string;\n salt: string;\n};\n\nexport type EmailBodyEncrypted = {\n encText: string;\n encAttachments?: string[];\n};\n\nexport type EmailBody = {\n text: string;\n attachments?: string[];\n};\n\nexport type EmailPublicParameters = {\n subject: string;\n createdAt: string;\n sender: User;\n recipient: User;\n recipients?: User[];\n replyToEmailID?: string;\n labels?: string[];\n};\n\nexport type Email = {\n id: string;\n body: EmailBody;\n params: EmailPublicParameters;\n};\n\nexport interface MailCache<Email> {\n esCache: Map<string, Email>;\n cacheSize: number;\n isCacheLimited: boolean;\n isCacheReady: boolean;\n}\nexport interface EmailSearchResult {\n email: Email;\n score?: number;\n}\n\nexport enum KeystoreType {\n ENCRYPTION = 'Encryption',\n RECOVERY = 'Recovery',\n}\n"],"mappings":";AAwHA,IAAY,sDAAL;AACL;AACA"}
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PublicKeys, PublicKeysBase64 } from "./types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/converters.d.ts
|
|
4
4
|
/**
|
|
@@ -91,9 +91,6 @@ declare function bytesToMnemonic(bytes: Uint8Array): string;
|
|
|
91
91
|
declare function generateUuid(): string;
|
|
92
92
|
declare function uuidToBytes(uuid: string): Uint8Array;
|
|
93
93
|
declare function bytesToUuid(bytes: Uint8Array): string;
|
|
94
|
-
declare namespace index_d_exports {
|
|
95
|
-
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8, uuidToBytes };
|
|
96
|
-
}
|
|
97
94
|
//#endregion
|
|
98
|
-
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64,
|
|
95
|
+
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8, uuidToBytes };
|
|
99
96
|
//# sourceMappingURL=utils.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils/converters.ts","../src/utils/keyConverters.ts","../src/utils/genMnemonic.ts","../src/utils/genID.ts"],"mappings":";;;;;;AAQA;;;iBAAgB,eAAA,CAAgB,KAAA,EAAO,UAAA;;AAUvC;;;;;iBAAgB,WAAA,CAAY,GAAA,WAAc,UAAA;;;;;AAoB1C;;iBAVgB,WAAA,CAAY,KAAA,EAAO,UAAA;;;AAoBnC;;;;iBAVgB,eAAA,CAAgB,GAAA,WAAc,UAAA;AAsB9C;;;;;;AAAA,iBAZgB,kBAAA,CAAmB,MAAA,EAAQ,UAAA;;ACtC3C;;;;;iBDkDgB,kBAAA,CAAmB,GAAA,WAAc,UAAA;;;;;AApDjD;;;;iBCEsB,iBAAA,CAAkB,MAAA,EAAQ,gBAAA,GAAmB,OAAA,CAAQ,UAAA;ADQ3E;;;;;AAUA;AAVA,iBCYsB,iBAAA,CAAkB,GAAA,EAAK,UAAA,GAAa,OAAA,CAAQ,gBAAA;;;;;;ADtBlE;;iBEAgB,WAAA,CAAA;;;AFUhB;;;;iBEAgB,eAAA,CAAgB,QAAA,WAAmB,UAAA;AFUnD;;;;;AAUA;AAVA,iBEAgB,eAAA,CAAgB,KAAA,EAAO,UAAA;;;;;;AFpBvC;;iBGFgB,YAAA,CAAA;AAAA,iBAIA,WAAA,CAAY,IAAA,WAAe,UAAA;AAAA,iBAI3B,WAAA,CAAY,KAAA,EAAO,UAAA"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PublicKeys, PublicKeysBase64 } from "./types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/converters.d.ts
|
|
4
4
|
/**
|
|
@@ -91,9 +91,6 @@ declare function bytesToMnemonic(bytes: Uint8Array): string;
|
|
|
91
91
|
declare function generateUuid(): string;
|
|
92
92
|
declare function uuidToBytes(uuid: string): Uint8Array;
|
|
93
93
|
declare function bytesToUuid(bytes: Uint8Array): string;
|
|
94
|
-
declare namespace index_d_exports {
|
|
95
|
-
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8, uuidToBytes };
|
|
96
|
-
}
|
|
97
94
|
//#endregion
|
|
98
|
-
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64,
|
|
95
|
+
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8, uuidToBytes };
|
|
99
96
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../src/utils/converters.ts","../src/utils/keyConverters.ts","../src/utils/genMnemonic.ts","../src/utils/genID.ts"],"mappings":";;;;;;AAQA;;;iBAAgB,eAAA,CAAgB,KAAA,EAAO,UAAA;;AAUvC;;;;;iBAAgB,WAAA,CAAY,GAAA,WAAc,UAAA;;;;;AAoB1C;;iBAVgB,WAAA,CAAY,KAAA,EAAO,UAAA;;;AAoBnC;;;;iBAVgB,eAAA,CAAgB,GAAA,WAAc,UAAA;AAsB9C;;;;;;AAAA,iBAZgB,kBAAA,CAAmB,MAAA,EAAQ,UAAA;;ACtC3C;;;;;iBDkDgB,kBAAA,CAAmB,GAAA,WAAc,UAAA;;;;;AApDjD;;;;iBCEsB,iBAAA,CAAkB,MAAA,EAAQ,gBAAA,GAAmB,OAAA,CAAQ,UAAA;ADQ3E;;;;;AAUA;AAVA,iBCYsB,iBAAA,CAAkB,GAAA,EAAK,UAAA,GAAa,OAAA,CAAQ,gBAAA;;;;;;ADtBlE;;iBEAgB,WAAA,CAAA;;;AFUhB;;;;iBEAgB,eAAA,CAAgB,QAAA,WAAmB,UAAA;AFUnD;;;;;AAUA;AAVA,iBEAgB,eAAA,CAAgB,KAAA,EAAO,UAAA;;;;;;AFpBvC;;iBGFgB,YAAA,CAAA;AAAA,iBAIA,WAAA,CAAY,IAAA,WAAe,UAAA;AAAA,iBAI3B,WAAA,CAAY,KAAA,EAAO,UAAA"}
|
package/dist/utils.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_genID = require('./genID-YJSl3YhL.js');
|
|
2
3
|
|
|
3
|
-
exports.UTF8ToUint8 =
|
|
4
|
-
exports.base64ToPublicKey =
|
|
5
|
-
exports.base64ToUint8Array =
|
|
6
|
-
exports.bytesToMnemonic =
|
|
7
|
-
exports.bytesToUuid =
|
|
8
|
-
exports.genMnemonic =
|
|
9
|
-
exports.generateUuid =
|
|
10
|
-
exports.hexToUint8Array =
|
|
11
|
-
exports.mnemonicToBytes =
|
|
12
|
-
exports.publicKeyToBase64 =
|
|
13
|
-
exports.uint8ArrayToBase64 =
|
|
14
|
-
exports.uint8ArrayToHex =
|
|
15
|
-
exports.uint8ToUTF8 =
|
|
16
|
-
exports.uuidToBytes =
|
|
4
|
+
exports.UTF8ToUint8 = require_genID.UTF8ToUint8;
|
|
5
|
+
exports.base64ToPublicKey = require_genID.base64ToPublicKey;
|
|
6
|
+
exports.base64ToUint8Array = require_genID.base64ToUint8Array;
|
|
7
|
+
exports.bytesToMnemonic = require_genID.bytesToMnemonic;
|
|
8
|
+
exports.bytesToUuid = require_genID.bytesToUuid;
|
|
9
|
+
exports.genMnemonic = require_genID.genMnemonic;
|
|
10
|
+
exports.generateUuid = require_genID.generateUuid;
|
|
11
|
+
exports.hexToUint8Array = require_genID.hexToUint8Array;
|
|
12
|
+
exports.mnemonicToBytes = require_genID.mnemonicToBytes;
|
|
13
|
+
exports.publicKeyToBase64 = require_genID.publicKeyToBase64;
|
|
14
|
+
exports.uint8ArrayToBase64 = require_genID.uint8ArrayToBase64;
|
|
15
|
+
exports.uint8ArrayToHex = require_genID.uint8ArrayToHex;
|
|
16
|
+
exports.uint8ToUTF8 = require_genID.uint8ToUTF8;
|
|
17
|
+
exports.uuidToBytes = require_genID.uuidToBytes;
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as genMnemonic, c as publicKeyToBase64, d as hexToUint8Array, f as uint8ArrayToBase64, i as bytesToMnemonic, l as UTF8ToUint8, m as uint8ToUTF8, n as generateUuid, o as mnemonicToBytes, p as uint8ArrayToHex, r as uuidToBytes, s as base64ToPublicKey, t as bytesToUuid, u as base64ToUint8Array } from "./genID-3Er5IowC.mjs";
|
|
2
2
|
|
|
3
3
|
export { UTF8ToUint8, base64ToPublicKey, base64ToUint8Array, bytesToMnemonic, bytesToUuid, genMnemonic, generateUuid, hexToUint8Array, mnemonicToBytes, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8, uuidToBytes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "internxt-crypto",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -9,46 +9,56 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prepare": "husky",
|
|
12
|
-
"dev": "vite",
|
|
13
12
|
"build": "tsdown",
|
|
14
|
-
"start": "vite preview",
|
|
15
|
-
"build:staging": "vite build --mode staging",
|
|
16
13
|
"test": "vitest run",
|
|
17
14
|
"test:coverage": "vitest run --coverage",
|
|
18
15
|
"format": "prettier \"{src,tests}/**/*.{ts,tsx}\" --write",
|
|
19
16
|
"lint:ts": "eslint \"./{src,tests}/**/*.{ts,tsx}\"",
|
|
20
|
-
"lint:fix": "yarn run lint:ts --fix"
|
|
17
|
+
"lint:fix": "yarn run lint:ts --fix",
|
|
18
|
+
"unused": "knip"
|
|
21
19
|
},
|
|
22
20
|
"devDependencies": {
|
|
21
|
+
"@eslint/js": "^10.0.1",
|
|
23
22
|
"@internxt/eslint-config-internxt": "2.0.1",
|
|
24
23
|
"@internxt/prettier-config": "https://github.com/internxt/prettier-config.git#v1.0.2",
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
24
|
+
"@playwright/test": "^1.54.2",
|
|
25
|
+
"@types/node": "^25.2.3",
|
|
27
26
|
"@vitest/browser-playwright": "^4.0.10",
|
|
28
27
|
"@vitest/coverage-istanbul": "^4.0.10",
|
|
29
|
-
"
|
|
30
|
-
"eslint
|
|
31
|
-
"
|
|
28
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
29
|
+
"eslint": "^10.0.0",
|
|
30
|
+
"knip": "^5.84.0",
|
|
32
31
|
"lint-staged": "^16.1.4",
|
|
33
32
|
"playwright": "^1.54.1",
|
|
34
33
|
"prettier": "^3.6.2",
|
|
35
|
-
"tsdown": "^0.20.
|
|
34
|
+
"tsdown": "^0.20.1",
|
|
36
35
|
"typescript": "^5.9.3",
|
|
37
|
-
"vite": "^7.0.6",
|
|
38
36
|
"vitest": "^4.0.0"
|
|
39
37
|
},
|
|
40
38
|
"dependencies": {
|
|
41
|
-
"@
|
|
39
|
+
"@noble/ciphers": "^2.1.1",
|
|
42
40
|
"@noble/hashes": "^2.0.1",
|
|
43
41
|
"@noble/post-quantum": "^0.5.2",
|
|
44
42
|
"@scure/bip39": "^2.0.1",
|
|
45
|
-
"axios": "^1.11.0",
|
|
46
43
|
"flexsearch": "^0.8.205",
|
|
47
44
|
"hash-wasm": "^4.12.0",
|
|
48
45
|
"husky": "^9.1.7",
|
|
49
46
|
"idb": "^8.0.3",
|
|
50
47
|
"uuid": "^13.0.0"
|
|
51
48
|
},
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"import": "./dist/index.mjs",
|
|
53
|
+
"require": "./dist/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./*": {
|
|
56
|
+
"types": "./dist/*.d.ts",
|
|
57
|
+
"import": "./dist/*.mjs",
|
|
58
|
+
"require": "./dist/*.js"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"sideEffects": false,
|
|
52
62
|
"lint-staged": {
|
|
53
63
|
"*.{js,jsx,tsx,ts}": [
|
|
54
64
|
"prettier --write"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asymmetric-crypto-BORmLhnx.js","names":["ECC_ALGORITHM","AES_KEY_BIT_LENGTH","ECC_ALGORITHM"],"sources":["../src/asymmetric-crypto/ellipticCurve.ts","../src/asymmetric-crypto/keys.ts","../src/asymmetric-crypto/index.ts"],"sourcesContent":["import { ECC_ALGORITHM, AES_KEY_BIT_LENGTH } from '../constants';\n\n/**\n * Derives secret key from the other user's public key and own private key\n *\n * @param otherUserPublicKey - The public key of the other user\n * @param ownPrivateKey - The private key\n * @returns The derived secret key bits\n */\nexport async function deriveSecretKey(otherUserPublicKey: CryptoKey, ownPrivateKey: CryptoKey): Promise<Uint8Array> {\n try {\n const result = await crypto.subtle.deriveBits(\n {\n name: ECC_ALGORITHM,\n public: otherUserPublicKey,\n },\n ownPrivateKey,\n AES_KEY_BIT_LENGTH,\n );\n return new Uint8Array(result);\n } catch (error) {\n throw new Error('Failed to derive elliptic curve secret key', { cause: error });\n }\n}\n","import { ECC_ALGORITHM } from '../constants';\n\n/**\n * Generates elliptic curve key pair\n *\n * @returns The generated key pair\n */\nexport async function generateEccKeys(): Promise<CryptoKeyPair> {\n try {\n return (await crypto.subtle.generateKey(\n {\n name: ECC_ALGORITHM,\n },\n true,\n ['deriveBits'],\n )) as CryptoKeyPair;\n } catch (error) {\n throw new Error('Failed to generate elliptic curve key pair', { cause: error });\n }\n}\n\n/**\n * Converts public CryptoKey into Uint8Array using SubjectPublicKeyInfo format (RFC 5280)\n *\n * @returns The Uint8Array representation of the public key\n */\nexport async function exportPublicKey(key: CryptoKey): Promise<Uint8Array> {\n try {\n const result = await crypto.subtle.exportKey('spki', key);\n return new Uint8Array(result);\n } catch (error) {\n throw new Error('Failed to export public key', { cause: error });\n }\n}\n\n/**\n * Converts public key in SubjectPublicKeyInfo format (RFC 5280) to CryptoKey\n *\n * @returns The CryptoKey representation of the public key\n */\nexport async function importPublicKey(spkiKeyData: Uint8Array): Promise<CryptoKey> {\n try {\n return await crypto.subtle.importKey(\n 'spki',\n spkiKeyData as BufferSource,\n {\n name: ECC_ALGORITHM,\n },\n true,\n [],\n );\n } catch (error) {\n throw new Error('Failed to import public key', { cause: error });\n }\n}\n\n/**\n * Converts private key in CryptoKey to PKCS #8 format (RFC 5208)\n *\n * @returns The Uint8Array representation of the private key\n */\nexport async function exportPrivateKey(key: CryptoKey): Promise<Uint8Array> {\n try {\n const result = await crypto.subtle.exportKey('pkcs8', key);\n return new Uint8Array(result);\n } catch (error) {\n throw new Error('Failed to export private key', { cause: error });\n }\n}\n\n/**\n * Converts private key in PKCS #8 format (RFC 5208) to CryptoKey\n *\n * @returns The CryptoKey representation of the private key\n */\nexport async function importPrivateKey(pkcs8KeyData: Uint8Array): Promise<CryptoKey> {\n try {\n return await crypto.subtle.importKey(\n 'pkcs8',\n pkcs8KeyData as BufferSource,\n {\n name: ECC_ALGORITHM,\n },\n true,\n ['deriveBits'],\n );\n } catch (error) {\n throw new Error('Failed to import private key', { cause: error });\n }\n}\n","export * from './ellipticCurve';\nexport * from './keys';\n"],"mappings":";;;;;;;;;;;AASA,eAAsB,gBAAgB,oBAA+B,eAA+C;AAClH,KAAI;EACF,MAAM,SAAS,MAAM,OAAO,OAAO,WACjC;GACE,MAAMA;GACN,QAAQ;GACT,EACD,eACAC,qCACD;AACD,SAAO,IAAI,WAAW,OAAO;UACtB,OAAO;AACd,QAAM,IAAI,MAAM,8CAA8C,EAAE,OAAO,OAAO,CAAC;;;;;;;;;;;ACdnF,eAAsB,kBAA0C;AAC9D,KAAI;AACF,SAAQ,MAAM,OAAO,OAAO,YAC1B,EACE,MAAMC,iCACP,EACD,MACA,CAAC,aAAa,CACf;UACM,OAAO;AACd,QAAM,IAAI,MAAM,8CAA8C,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASnF,eAAsB,gBAAgB,KAAqC;AACzE,KAAI;EACF,MAAM,SAAS,MAAM,OAAO,OAAO,UAAU,QAAQ,IAAI;AACzD,SAAO,IAAI,WAAW,OAAO;UACtB,OAAO;AACd,QAAM,IAAI,MAAM,+BAA+B,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASpE,eAAsB,gBAAgB,aAA6C;AACjF,KAAI;AACF,SAAO,MAAM,OAAO,OAAO,UACzB,QACA,aACA,EACE,MAAMA,iCACP,EACD,MACA,EAAE,CACH;UACM,OAAO;AACd,QAAM,IAAI,MAAM,+BAA+B,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASpE,eAAsB,iBAAiB,KAAqC;AAC1E,KAAI;EACF,MAAM,SAAS,MAAM,OAAO,OAAO,UAAU,SAAS,IAAI;AAC1D,SAAO,IAAI,WAAW,OAAO;UACtB,OAAO;AACd,QAAM,IAAI,MAAM,gCAAgC,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASrE,eAAsB,iBAAiB,cAA8C;AACnF,KAAI;AACF,SAAO,MAAM,OAAO,OAAO,UACzB,SACA,cACA,EACE,MAAMA,iCACP,EACD,MACA,CAAC,aAAa,CACf;UACM,OAAO;AACd,QAAM,IAAI,MAAM,gCAAgC,EAAE,OAAO,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asymmetric-crypto-CyXsV4XT.mjs","names":[],"sources":["../src/asymmetric-crypto/ellipticCurve.ts","../src/asymmetric-crypto/keys.ts","../src/asymmetric-crypto/index.ts"],"sourcesContent":["import { ECC_ALGORITHM, AES_KEY_BIT_LENGTH } from '../constants';\n\n/**\n * Derives secret key from the other user's public key and own private key\n *\n * @param otherUserPublicKey - The public key of the other user\n * @param ownPrivateKey - The private key\n * @returns The derived secret key bits\n */\nexport async function deriveSecretKey(otherUserPublicKey: CryptoKey, ownPrivateKey: CryptoKey): Promise<Uint8Array> {\n try {\n const result = await crypto.subtle.deriveBits(\n {\n name: ECC_ALGORITHM,\n public: otherUserPublicKey,\n },\n ownPrivateKey,\n AES_KEY_BIT_LENGTH,\n );\n return new Uint8Array(result);\n } catch (error) {\n throw new Error('Failed to derive elliptic curve secret key', { cause: error });\n }\n}\n","import { ECC_ALGORITHM } from '../constants';\n\n/**\n * Generates elliptic curve key pair\n *\n * @returns The generated key pair\n */\nexport async function generateEccKeys(): Promise<CryptoKeyPair> {\n try {\n return (await crypto.subtle.generateKey(\n {\n name: ECC_ALGORITHM,\n },\n true,\n ['deriveBits'],\n )) as CryptoKeyPair;\n } catch (error) {\n throw new Error('Failed to generate elliptic curve key pair', { cause: error });\n }\n}\n\n/**\n * Converts public CryptoKey into Uint8Array using SubjectPublicKeyInfo format (RFC 5280)\n *\n * @returns The Uint8Array representation of the public key\n */\nexport async function exportPublicKey(key: CryptoKey): Promise<Uint8Array> {\n try {\n const result = await crypto.subtle.exportKey('spki', key);\n return new Uint8Array(result);\n } catch (error) {\n throw new Error('Failed to export public key', { cause: error });\n }\n}\n\n/**\n * Converts public key in SubjectPublicKeyInfo format (RFC 5280) to CryptoKey\n *\n * @returns The CryptoKey representation of the public key\n */\nexport async function importPublicKey(spkiKeyData: Uint8Array): Promise<CryptoKey> {\n try {\n return await crypto.subtle.importKey(\n 'spki',\n spkiKeyData as BufferSource,\n {\n name: ECC_ALGORITHM,\n },\n true,\n [],\n );\n } catch (error) {\n throw new Error('Failed to import public key', { cause: error });\n }\n}\n\n/**\n * Converts private key in CryptoKey to PKCS #8 format (RFC 5208)\n *\n * @returns The Uint8Array representation of the private key\n */\nexport async function exportPrivateKey(key: CryptoKey): Promise<Uint8Array> {\n try {\n const result = await crypto.subtle.exportKey('pkcs8', key);\n return new Uint8Array(result);\n } catch (error) {\n throw new Error('Failed to export private key', { cause: error });\n }\n}\n\n/**\n * Converts private key in PKCS #8 format (RFC 5208) to CryptoKey\n *\n * @returns The CryptoKey representation of the private key\n */\nexport async function importPrivateKey(pkcs8KeyData: Uint8Array): Promise<CryptoKey> {\n try {\n return await crypto.subtle.importKey(\n 'pkcs8',\n pkcs8KeyData as BufferSource,\n {\n name: ECC_ALGORITHM,\n },\n true,\n ['deriveBits'],\n );\n } catch (error) {\n throw new Error('Failed to import private key', { cause: error });\n }\n}\n","export * from './ellipticCurve';\nexport * from './keys';\n"],"mappings":";;;;;;;;;;;AASA,eAAsB,gBAAgB,oBAA+B,eAA+C;AAClH,KAAI;EACF,MAAM,SAAS,MAAM,OAAO,OAAO,WACjC;GACE,MAAM;GACN,QAAQ;GACT,EACD,eACA,mBACD;AACD,SAAO,IAAI,WAAW,OAAO;UACtB,OAAO;AACd,QAAM,IAAI,MAAM,8CAA8C,EAAE,OAAO,OAAO,CAAC;;;;;;;;;;;ACdnF,eAAsB,kBAA0C;AAC9D,KAAI;AACF,SAAQ,MAAM,OAAO,OAAO,YAC1B,EACE,MAAM,eACP,EACD,MACA,CAAC,aAAa,CACf;UACM,OAAO;AACd,QAAM,IAAI,MAAM,8CAA8C,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASnF,eAAsB,gBAAgB,KAAqC;AACzE,KAAI;EACF,MAAM,SAAS,MAAM,OAAO,OAAO,UAAU,QAAQ,IAAI;AACzD,SAAO,IAAI,WAAW,OAAO;UACtB,OAAO;AACd,QAAM,IAAI,MAAM,+BAA+B,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASpE,eAAsB,gBAAgB,aAA6C;AACjF,KAAI;AACF,SAAO,MAAM,OAAO,OAAO,UACzB,QACA,aACA,EACE,MAAM,eACP,EACD,MACA,EAAE,CACH;UACM,OAAO;AACd,QAAM,IAAI,MAAM,+BAA+B,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASpE,eAAsB,iBAAiB,KAAqC;AAC1E,KAAI;EACF,MAAM,SAAS,MAAM,OAAO,OAAO,UAAU,SAAS,IAAI;AAC1D,SAAO,IAAI,WAAW,OAAO;UACtB,OAAO;AACd,QAAM,IAAI,MAAM,gCAAgC,EAAE,OAAO,OAAO,CAAC;;;;;;;;AASrE,eAAsB,iBAAiB,cAA8C;AACnF,KAAI;AACF,SAAO,MAAM,OAAO,OAAO,UACzB,SACA,cACA,EACE,MAAM,eACP,EACD,MACA,CAAC,aAAa,CACf;UACM,OAAO;AACd,QAAM,IAAI,MAAM,gCAAgC,EAAE,OAAO,OAAO,CAAC"}
|