internxt-crypto 0.0.10-alpha → 0.0.11

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.
Files changed (148) hide show
  1. package/README.md +3 -4
  2. package/dist/asymmetric-crypto-BORmLhnx.js +143 -0
  3. package/dist/asymmetric-crypto-BORmLhnx.js.map +1 -0
  4. package/dist/asymmetric-crypto-CyXsV4XT.mjs +102 -0
  5. package/dist/asymmetric-crypto-CyXsV4XT.mjs.map +1 -0
  6. package/dist/asymmetric-crypto.d.mts +9 -3
  7. package/dist/asymmetric-crypto.d.ts +9 -3
  8. package/dist/asymmetric-crypto.js +8 -92
  9. package/dist/asymmetric-crypto.mjs +2 -84
  10. package/dist/chunk-DWirmd9C.mjs +18 -0
  11. package/dist/chunk-Dt-PWiN7.js +60 -0
  12. package/dist/constants-Ccp21E03.js +208 -0
  13. package/dist/constants-Ccp21E03.js.map +1 -0
  14. package/dist/constants-kTeX-2T0.mjs +34 -0
  15. package/dist/constants-kTeX-2T0.mjs.map +1 -0
  16. package/dist/constants.d.mts +5 -11
  17. package/dist/constants.d.ts +5 -11
  18. package/dist/constants.js +30 -79
  19. package/dist/constants.mjs +2 -41
  20. package/dist/derive-key-Be7hS-cN.mjs +751 -0
  21. package/dist/derive-key-Be7hS-cN.mjs.map +1 -0
  22. package/dist/derive-key-CBf2WxJd.js +2513 -0
  23. package/dist/derive-key-CBf2WxJd.js.map +1 -0
  24. package/dist/derive-key.d.mts +14 -8
  25. package/dist/derive-key.d.ts +14 -8
  26. package/dist/derive-key.js +15 -795
  27. package/dist/derive-key.mjs +5 -783
  28. package/dist/email-crypto-BrT98taw.js +617 -0
  29. package/dist/email-crypto-BrT98taw.js.map +1 -0
  30. package/dist/email-crypto-DJUEjTxA.mjs +534 -0
  31. package/dist/email-crypto-DJUEjTxA.mjs.map +1 -0
  32. package/dist/email-crypto.d.mts +58 -78
  33. package/dist/email-crypto.d.ts +58 -78
  34. package/dist/email-crypto.js +17 -1409
  35. package/dist/email-crypto.mjs +8 -1381
  36. package/dist/email-search.d.mts +39 -32
  37. package/dist/email-search.d.ts +39 -32
  38. package/dist/email-search.js +572 -540
  39. package/dist/email-search.js.map +1 -1
  40. package/dist/email-search.mjs +567 -539
  41. package/dist/email-search.mjs.map +1 -1
  42. package/dist/hash-BoqwNkcd.js +190 -0
  43. package/dist/hash-BoqwNkcd.js.map +1 -0
  44. package/dist/hash-CXeGAwai.mjs +131 -0
  45. package/dist/hash-CXeGAwai.mjs.map +1 -0
  46. package/dist/hash.d.mts +21 -15
  47. package/dist/hash.d.ts +21 -15
  48. package/dist/hash.js +11 -95
  49. package/dist/hash.mjs +2 -84
  50. package/dist/index-CQqgKsbX.d.ts +50 -0
  51. package/dist/index-CintVUbp.d.ts +97 -0
  52. package/dist/index-D5pBU_A5.d.mts +50 -0
  53. package/dist/index-MaOov-ag.d.mts +97 -0
  54. package/dist/index.d.mts +35 -18
  55. package/dist/index.d.ts +35 -18
  56. package/dist/index.js +103 -2685
  57. package/dist/index.mjs +15 -2538
  58. package/dist/keystore-crypto-B4yCVo9l.js +182 -0
  59. package/dist/keystore-crypto-B4yCVo9l.js.map +1 -0
  60. package/dist/keystore-crypto-Bjgriq9h.mjs +159 -0
  61. package/dist/keystore-crypto-Bjgriq9h.mjs.map +1 -0
  62. package/dist/keystore-crypto.d.mts +20 -46
  63. package/dist/keystore-crypto.d.ts +20 -46
  64. package/dist/keystore-crypto.js +11 -530
  65. package/dist/keystore-crypto.mjs +9 -501
  66. package/dist/keystore-service.d.mts +44 -78
  67. package/dist/keystore-service.d.ts +44 -78
  68. package/dist/keystore-service.js +113 -340
  69. package/dist/keystore-service.js.map +1 -1
  70. package/dist/keystore-service.mjs +107 -335
  71. package/dist/keystore-service.mjs.map +1 -1
  72. package/dist/post-quantum-crypto-CAi-cEkV.js +189 -0
  73. package/dist/post-quantum-crypto-CAi-cEkV.js.map +1 -0
  74. package/dist/post-quantum-crypto-Vv34t6gX.mjs +154 -0
  75. package/dist/post-quantum-crypto-Vv34t6gX.mjs.map +1 -0
  76. package/dist/post-quantum-crypto.d.mts +2 -72
  77. package/dist/post-quantum-crypto.d.ts +2 -72
  78. package/dist/post-quantum-crypto.js +13 -92
  79. package/dist/post-quantum-crypto.mjs +2 -89
  80. package/dist/storage-service-BgIK2aYZ.js +82 -0
  81. package/dist/storage-service-BgIK2aYZ.js.map +1 -0
  82. package/dist/storage-service-CubCbhY2.mjs +65 -0
  83. package/dist/storage-service-CubCbhY2.mjs.map +1 -0
  84. package/dist/storage-service.d.mts +2 -53
  85. package/dist/storage-service.d.ts +2 -53
  86. package/dist/storage-service.js +12 -68
  87. package/dist/storage-service.mjs +2 -66
  88. package/dist/symmetric-crypto-CrdS1Che.mjs +197 -0
  89. package/dist/symmetric-crypto-CrdS1Che.mjs.map +1 -0
  90. package/dist/symmetric-crypto-D65zB396.js +244 -0
  91. package/dist/symmetric-crypto-D65zB396.js.map +1 -0
  92. package/dist/symmetric-crypto.d.mts +12 -8
  93. package/dist/symmetric-crypto.d.ts +12 -8
  94. package/dist/symmetric-crypto.js +10 -142
  95. package/dist/symmetric-crypto.mjs +3 -133
  96. package/dist/types-52g887Zi.js +16 -0
  97. package/dist/types-52g887Zi.js.map +1 -0
  98. package/dist/types-BiEoleqw.mjs +10 -0
  99. package/dist/types-BiEoleqw.mjs.map +1 -0
  100. package/dist/types-Ds3ivE9W.d.ts +104 -0
  101. package/dist/types-DwQJtrTx.d.mts +104 -0
  102. package/dist/types.d.mts +2 -102
  103. package/dist/types.d.ts +2 -102
  104. package/dist/types.js +2 -13
  105. package/dist/types.mjs +2 -11
  106. package/dist/utils-CNs3cyDj.js +263 -0
  107. package/dist/utils-CNs3cyDj.js.map +1 -0
  108. package/dist/utils-DS04iUcX.mjs +173 -0
  109. package/dist/utils-DS04iUcX.mjs.map +1 -0
  110. package/dist/utils.d.mts +37 -78
  111. package/dist/utils.d.ts +37 -78
  112. package/dist/utils.js +16 -313
  113. package/dist/utils.mjs +2 -272
  114. package/package.json +15 -90
  115. package/dist/asymmetric-crypto.js.map +0 -1
  116. package/dist/asymmetric-crypto.mjs.map +0 -1
  117. package/dist/constants.js.map +0 -1
  118. package/dist/constants.mjs.map +0 -1
  119. package/dist/derive-key.js.map +0 -1
  120. package/dist/derive-key.mjs.map +0 -1
  121. package/dist/email-crypto.js.map +0 -1
  122. package/dist/email-crypto.mjs.map +0 -1
  123. package/dist/email-service.d.mts +0 -38
  124. package/dist/email-service.d.ts +0 -38
  125. package/dist/email-service.js +0 -154
  126. package/dist/email-service.js.map +0 -1
  127. package/dist/email-service.mjs +0 -147
  128. package/dist/email-service.mjs.map +0 -1
  129. package/dist/hash.js.map +0 -1
  130. package/dist/hash.mjs.map +0 -1
  131. package/dist/index.js.map +0 -1
  132. package/dist/index.mjs.map +0 -1
  133. package/dist/keystore-crypto.js.map +0 -1
  134. package/dist/keystore-crypto.mjs.map +0 -1
  135. package/dist/kyber768-B87rMQ7u.d.mts +0 -30
  136. package/dist/kyber768-B87rMQ7u.d.ts +0 -30
  137. package/dist/post-quantum-crypto.js.map +0 -1
  138. package/dist/post-quantum-crypto.mjs.map +0 -1
  139. package/dist/storage-service.js.map +0 -1
  140. package/dist/storage-service.mjs.map +0 -1
  141. package/dist/symmetric-crypto.js.map +0 -1
  142. package/dist/symmetric-crypto.mjs.map +0 -1
  143. package/dist/types.js.map +0 -1
  144. package/dist/types.mjs.map +0 -1
  145. package/dist/utils-BDaK_d6T.d.ts +0 -114
  146. package/dist/utils-v34IRTIx.d.mts +0 -114
  147. package/dist/utils.js.map +0 -1
  148. package/dist/utils.mjs.map +0 -1
@@ -1,90 +1,58 @@
1
- export { g as createPwdProtectedEmail, i as createPwdProtectedEmailAndSubject, f as decryptEmailAndSubjectHybrid, d as decryptEmailHybrid, h as decryptPwdProtectedEmail, j as decryptPwdProtectedEmailAndSubject, b as encryptEmailAndSubjectHybrid, c as encryptEmailAndSubjectHybridForMultipleRecipients, e as encryptEmailHybrid, a as encryptEmailHybridForMultipleRecipients, m as generateEmailID, k as getAux, l as getAuxWithoutSubject } from './utils-v34IRTIx.mjs';
2
- import { User, EmailBody, HybridEncKey, PwdProtectedKey, EmailPublicParameters, HybridEncryptedEmail, PwdProtectedEmail, Email, PublicKeys, PrivateKeys } from './types.mjs';
1
+ import { _ as PwdProtectedEmail, b as User, h as PublicKeys, i as EmailKeys, o as EmailPublicParameters, p as PrivateKeys, t as Email, u as HybridEncryptedEmail, x as UserWithPublicKeys } from "./types-DwQJtrTx.mjs";
3
2
 
3
+ //#region src/email-crypto/hybridEncyptedEmail.d.ts
4
4
  /**
5
- * Converts a User type into a base64 string.
5
+ * Encrypts the email using hybrid encryption.
6
6
  *
7
- * @param user - The given user.
8
- * @returns The base64 representation of the user.
7
+ * @param email - The email to encrypt.
8
+ * @param recipientPublicKeys - The public keys of the recipient.
9
+ * @param senderPrivateKey - The private key of the sender.
10
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
11
+ * @returns The encrypted email
9
12
  */
10
- declare function userToBase64(user: User): string;
13
+ declare function encryptEmailHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail>;
11
14
  /**
12
- * Converts a base64 string into a User type
15
+ * Encrypts the email using hybrid encryption for multiple recipients.
13
16
  *
14
- * @param base64 - The base64 representation of the user.
15
- * @returns The User type.
17
+ * @param email - The email to encrypt.
18
+ * @param recipients - The recipients with corresponding public keys.
19
+ * @param senderPrivateKey - The private key of the sender.
20
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
21
+ * @returns The set of encrypted email
16
22
  */
17
- declare function base64ToUser(base64: string): User;
23
+ declare function encryptEmailHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail[]>;
18
24
  /**
19
- * Converts an EmailBody type into a Uint8Array array.
25
+ * Decrypts the email using hybrid encryption.
20
26
  *
21
- * @param body - The email body.
22
- * @returns The Uint8Array array representation of the EmailBody type.
27
+ * @param encryptedEmail - The encrypted email.
28
+ * @param senderPublicKeys - The public key of the sender.
29
+ * @param recipientPrivateKeys - The private key of the recipient.
30
+ * @returns The decrypted email
23
31
  */
24
- declare function emailBodyToBinary(body: EmailBody): Uint8Array;
32
+ declare function decryptEmailHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
33
+ //#endregion
34
+ //#region src/email-crypto/pwdProtectedEmail.d.ts
25
35
  /**
26
- * Converts an Uint8Array array into EmailBody type.
36
+ * Creates a password-protected email.
27
37
  *
28
- * @param array - The Uint8Array array.
29
- * @returns The EmailBody type representation of the Uint8Array.
38
+ * @param email - The email to password-protect
39
+ * @param password - The secret password shared among recipients
40
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
41
+ * @returns The password-protected email
30
42
  */
31
- declare function binaryToEmailBody(array: Uint8Array): EmailBody;
43
+ declare function createPwdProtectedEmail(email: Email, password: string, isSubjectEncrypted?: boolean): Promise<PwdProtectedEmail>;
32
44
  /**
33
- * Converts a hybrid key of the type HybridEncKey into base64 string.
45
+ * Opens a password-protected email.
34
46
  *
35
- * @param encHybridKey - The HybridEncKey key.
36
- * @returns The resulting base64 key encoding.
47
+ * @param encryptedEmail - The encrypted email
48
+ * @param password - The secret password shared among recipients.
49
+ * @returns The decrypted email
37
50
  */
38
- declare function encHybridKeyToBase64(encHybridKey: HybridEncKey): string;
39
- /**
40
- * Converts a base64 string into a hybrid key of the type HybridEncKey.
41
- *
42
- * @param base - The base64 encoding of the hybrid key.
43
- * @returns The resulting HybridEncKey key.
44
- */
45
- declare function base64ToEncHybridKey(base64: string): HybridEncKey;
46
- /**
47
- * Converts a password-protected key of the type PwdProtectedKey into base64 string.
48
- *
49
- * @param pwdProtectedKey - The password-protected key of the type PwdProtectedKey.
50
- * @returns The resulting base64 key encoding.
51
- */
52
- declare function pwdProtectedKeyToBase64(pwdProtectedKey: PwdProtectedKey): string;
53
- /**
54
- * Converts a base64 string into a password-protected key of the type PwdProtectedKey.
55
- *
56
- * @param base64 - The base64 string.
57
- * @returns The resulting PwdProtectedKey key.
58
- */
59
- declare function base64ToPwdProtectedKey(base64: string): PwdProtectedKey;
60
- /**
61
- * Converts an email public parameters of type EmailPublicParameters into base64 string.
62
- *
63
- * @param params - The EmailPublicParameters email paramaters.
64
- * @returns The resulting base64 string encoding.
65
- */
66
- declare function paramsToBase64(params: EmailPublicParameters): string;
67
- /**
68
- * Converts a base64 string into an email paramaters of the type EmailPublicParameters.
69
- *
70
- * @param base64 - The base64 string.
71
- * @returns The resulting EmailPublicParameters email parameters.
72
- */
73
- declare function base64ToParams(base64: string): EmailPublicParameters;
74
- /**
75
- * Converts an encrypted via hybrid encryption email into base64 string.
76
- *
77
- * @param email - The HybridEncryptedEmail encrypted via hybrid encryption email.
78
- * @returns The resulting base64 string encoding.
79
- */
80
- declare function hybridEncyptedEmailToBase64(email: HybridEncryptedEmail): string;
81
- /**
82
- * Converts a pwd protected email into base64 string.
83
- *
84
- * @param email - The PwdProtectedEmail pwd protected email.
85
- * @returns The resulting base64 string encoding.
86
- */
87
- declare function pwdProtectedEmailToBase64(email: PwdProtectedEmail): string;
51
+ declare function decryptPwdProtectedEmail(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
52
+ //#endregion
53
+ //#region src/email-crypto/converters.d.ts
54
+ declare function userToBytes(user: User): Uint8Array;
55
+ declare function recipientsToBytes(recipients: User[]): Uint8Array;
88
56
  /**
89
57
  * Converts an Email type into a Uint8Array array.
90
58
  *
@@ -92,15 +60,27 @@ declare function pwdProtectedEmailToBase64(email: PwdProtectedEmail): string;
92
60
  * @returns The Uint8Array array representation of the Email type.
93
61
  */
94
62
  declare function emailToBinary(email: Email): Uint8Array;
95
-
63
+ //#endregion
64
+ //#region src/email-crypto/emailKeys.d.ts
96
65
  /**
97
66
  * Generates public and private keys for email service.
98
67
  *
99
68
  * @returns The user's private and public keys
100
69
  */
101
- declare function generateEmailKeys(): Promise<{
102
- publicKeys: PublicKeys;
103
- privateKeys: PrivateKeys;
104
- }>;
105
-
106
- export { base64ToEncHybridKey, base64ToParams, base64ToPwdProtectedKey, base64ToUser, binaryToEmailBody, emailBodyToBinary, emailToBinary, encHybridKeyToBase64, generateEmailKeys, hybridEncyptedEmailToBase64, paramsToBase64, pwdProtectedEmailToBase64, pwdProtectedKeyToBase64, userToBase64 };
70
+ declare function generateEmailKeys(): Promise<EmailKeys>;
71
+ //#endregion
72
+ //#region src/email-crypto/utils.d.ts
73
+ /**
74
+ * Creates an auxiliary string from public fields of the email.
75
+ *
76
+ * @param params - The email public parameters.
77
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
78
+ * @returns The resulting auxiliary string
79
+ */
80
+ declare function getAux(params: EmailPublicParameters, isSubjectEncrypted: boolean): Uint8Array;
81
+ declare namespace index_d_exports {
82
+ export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, userToBytes };
83
+ }
84
+ //#endregion
85
+ export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, index_d_exports as t, userToBytes };
86
+ //# sourceMappingURL=email-crypto.d.mts.map
@@ -1,90 +1,58 @@
1
- export { g as createPwdProtectedEmail, i as createPwdProtectedEmailAndSubject, f as decryptEmailAndSubjectHybrid, d as decryptEmailHybrid, h as decryptPwdProtectedEmail, j as decryptPwdProtectedEmailAndSubject, b as encryptEmailAndSubjectHybrid, c as encryptEmailAndSubjectHybridForMultipleRecipients, e as encryptEmailHybrid, a as encryptEmailHybridForMultipleRecipients, m as generateEmailID, k as getAux, l as getAuxWithoutSubject } from './utils-BDaK_d6T.js';
2
- import { User, EmailBody, HybridEncKey, PwdProtectedKey, EmailPublicParameters, HybridEncryptedEmail, PwdProtectedEmail, Email, PublicKeys, PrivateKeys } from './types.js';
1
+ import { _ as PwdProtectedEmail, b as User, h as PublicKeys, i as EmailKeys, o as EmailPublicParameters, p as PrivateKeys, t as Email, u as HybridEncryptedEmail, x as UserWithPublicKeys } from "./types-Ds3ivE9W.js";
3
2
 
3
+ //#region src/email-crypto/hybridEncyptedEmail.d.ts
4
4
  /**
5
- * Converts a User type into a base64 string.
5
+ * Encrypts the email using hybrid encryption.
6
6
  *
7
- * @param user - The given user.
8
- * @returns The base64 representation of the user.
7
+ * @param email - The email to encrypt.
8
+ * @param recipientPublicKeys - The public keys of the recipient.
9
+ * @param senderPrivateKey - The private key of the sender.
10
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
11
+ * @returns The encrypted email
9
12
  */
10
- declare function userToBase64(user: User): string;
13
+ declare function encryptEmailHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail>;
11
14
  /**
12
- * Converts a base64 string into a User type
15
+ * Encrypts the email using hybrid encryption for multiple recipients.
13
16
  *
14
- * @param base64 - The base64 representation of the user.
15
- * @returns The User type.
17
+ * @param email - The email to encrypt.
18
+ * @param recipients - The recipients with corresponding public keys.
19
+ * @param senderPrivateKey - The private key of the sender.
20
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
21
+ * @returns The set of encrypted email
16
22
  */
17
- declare function base64ToUser(base64: string): User;
23
+ declare function encryptEmailHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail[]>;
18
24
  /**
19
- * Converts an EmailBody type into a Uint8Array array.
25
+ * Decrypts the email using hybrid encryption.
20
26
  *
21
- * @param body - The email body.
22
- * @returns The Uint8Array array representation of the EmailBody type.
27
+ * @param encryptedEmail - The encrypted email.
28
+ * @param senderPublicKeys - The public key of the sender.
29
+ * @param recipientPrivateKeys - The private key of the recipient.
30
+ * @returns The decrypted email
23
31
  */
24
- declare function emailBodyToBinary(body: EmailBody): Uint8Array;
32
+ declare function decryptEmailHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
33
+ //#endregion
34
+ //#region src/email-crypto/pwdProtectedEmail.d.ts
25
35
  /**
26
- * Converts an Uint8Array array into EmailBody type.
36
+ * Creates a password-protected email.
27
37
  *
28
- * @param array - The Uint8Array array.
29
- * @returns The EmailBody type representation of the Uint8Array.
38
+ * @param email - The email to password-protect
39
+ * @param password - The secret password shared among recipients
40
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
41
+ * @returns The password-protected email
30
42
  */
31
- declare function binaryToEmailBody(array: Uint8Array): EmailBody;
43
+ declare function createPwdProtectedEmail(email: Email, password: string, isSubjectEncrypted?: boolean): Promise<PwdProtectedEmail>;
32
44
  /**
33
- * Converts a hybrid key of the type HybridEncKey into base64 string.
45
+ * Opens a password-protected email.
34
46
  *
35
- * @param encHybridKey - The HybridEncKey key.
36
- * @returns The resulting base64 key encoding.
47
+ * @param encryptedEmail - The encrypted email
48
+ * @param password - The secret password shared among recipients.
49
+ * @returns The decrypted email
37
50
  */
38
- declare function encHybridKeyToBase64(encHybridKey: HybridEncKey): string;
39
- /**
40
- * Converts a base64 string into a hybrid key of the type HybridEncKey.
41
- *
42
- * @param base - The base64 encoding of the hybrid key.
43
- * @returns The resulting HybridEncKey key.
44
- */
45
- declare function base64ToEncHybridKey(base64: string): HybridEncKey;
46
- /**
47
- * Converts a password-protected key of the type PwdProtectedKey into base64 string.
48
- *
49
- * @param pwdProtectedKey - The password-protected key of the type PwdProtectedKey.
50
- * @returns The resulting base64 key encoding.
51
- */
52
- declare function pwdProtectedKeyToBase64(pwdProtectedKey: PwdProtectedKey): string;
53
- /**
54
- * Converts a base64 string into a password-protected key of the type PwdProtectedKey.
55
- *
56
- * @param base64 - The base64 string.
57
- * @returns The resulting PwdProtectedKey key.
58
- */
59
- declare function base64ToPwdProtectedKey(base64: string): PwdProtectedKey;
60
- /**
61
- * Converts an email public parameters of type EmailPublicParameters into base64 string.
62
- *
63
- * @param params - The EmailPublicParameters email paramaters.
64
- * @returns The resulting base64 string encoding.
65
- */
66
- declare function paramsToBase64(params: EmailPublicParameters): string;
67
- /**
68
- * Converts a base64 string into an email paramaters of the type EmailPublicParameters.
69
- *
70
- * @param base64 - The base64 string.
71
- * @returns The resulting EmailPublicParameters email parameters.
72
- */
73
- declare function base64ToParams(base64: string): EmailPublicParameters;
74
- /**
75
- * Converts an encrypted via hybrid encryption email into base64 string.
76
- *
77
- * @param email - The HybridEncryptedEmail encrypted via hybrid encryption email.
78
- * @returns The resulting base64 string encoding.
79
- */
80
- declare function hybridEncyptedEmailToBase64(email: HybridEncryptedEmail): string;
81
- /**
82
- * Converts a pwd protected email into base64 string.
83
- *
84
- * @param email - The PwdProtectedEmail pwd protected email.
85
- * @returns The resulting base64 string encoding.
86
- */
87
- declare function pwdProtectedEmailToBase64(email: PwdProtectedEmail): string;
51
+ declare function decryptPwdProtectedEmail(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
52
+ //#endregion
53
+ //#region src/email-crypto/converters.d.ts
54
+ declare function userToBytes(user: User): Uint8Array;
55
+ declare function recipientsToBytes(recipients: User[]): Uint8Array;
88
56
  /**
89
57
  * Converts an Email type into a Uint8Array array.
90
58
  *
@@ -92,15 +60,27 @@ declare function pwdProtectedEmailToBase64(email: PwdProtectedEmail): string;
92
60
  * @returns The Uint8Array array representation of the Email type.
93
61
  */
94
62
  declare function emailToBinary(email: Email): Uint8Array;
95
-
63
+ //#endregion
64
+ //#region src/email-crypto/emailKeys.d.ts
96
65
  /**
97
66
  * Generates public and private keys for email service.
98
67
  *
99
68
  * @returns The user's private and public keys
100
69
  */
101
- declare function generateEmailKeys(): Promise<{
102
- publicKeys: PublicKeys;
103
- privateKeys: PrivateKeys;
104
- }>;
105
-
106
- export { base64ToEncHybridKey, base64ToParams, base64ToPwdProtectedKey, base64ToUser, binaryToEmailBody, emailBodyToBinary, emailToBinary, encHybridKeyToBase64, generateEmailKeys, hybridEncyptedEmailToBase64, paramsToBase64, pwdProtectedEmailToBase64, pwdProtectedKeyToBase64, userToBase64 };
70
+ declare function generateEmailKeys(): Promise<EmailKeys>;
71
+ //#endregion
72
+ //#region src/email-crypto/utils.d.ts
73
+ /**
74
+ * Creates an auxiliary string from public fields of the email.
75
+ *
76
+ * @param params - The email public parameters.
77
+ * @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
78
+ * @returns The resulting auxiliary string
79
+ */
80
+ declare function getAux(params: EmailPublicParameters, isSubjectEncrypted: boolean): Uint8Array;
81
+ declare namespace index_d_exports {
82
+ export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, userToBytes };
83
+ }
84
+ //#endregion
85
+ export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, index_d_exports as t, userToBytes };
86
+ //# sourceMappingURL=email-crypto.d.ts.map