internxt-crypto 0.0.8-alpha → 0.0.10-alpha

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 (100) hide show
  1. package/README.md +0 -2
  2. package/dist/asymmetric-crypto.d.mts +41 -0
  3. package/dist/asymmetric-crypto.d.ts +41 -0
  4. package/dist/asymmetric-crypto.js +92 -0
  5. package/dist/asymmetric-crypto.js.map +1 -0
  6. package/dist/asymmetric-crypto.mjs +85 -0
  7. package/dist/asymmetric-crypto.mjs.map +1 -0
  8. package/dist/constants.d.mts +39 -0
  9. package/dist/constants.d.ts +39 -0
  10. package/dist/constants.js +80 -0
  11. package/dist/constants.js.map +1 -0
  12. package/dist/constants.mjs +42 -0
  13. package/dist/constants.mjs.map +1 -0
  14. package/dist/derive-key.d.mts +91 -0
  15. package/dist/derive-key.d.ts +91 -0
  16. package/dist/derive-key.js +795 -0
  17. package/dist/derive-key.js.map +1 -0
  18. package/dist/derive-key.mjs +784 -0
  19. package/dist/derive-key.mjs.map +1 -0
  20. package/dist/email-crypto.d.mts +106 -0
  21. package/dist/email-crypto.d.ts +106 -0
  22. package/dist/email-crypto.js +1409 -0
  23. package/dist/email-crypto.js.map +1 -0
  24. package/dist/email-crypto.mjs +1381 -0
  25. package/dist/email-crypto.mjs.map +1 -0
  26. package/dist/email-search.d.mts +228 -0
  27. package/dist/email-search.d.ts +228 -0
  28. package/dist/email-search.js +605 -0
  29. package/dist/email-search.js.map +1 -0
  30. package/dist/email-search.mjs +580 -0
  31. package/dist/email-search.mjs.map +1 -0
  32. package/dist/email-service.d.mts +38 -0
  33. package/dist/email-service.d.ts +38 -0
  34. package/dist/email-service.js +154 -0
  35. package/dist/email-service.js.map +1 -0
  36. package/dist/email-service.mjs +147 -0
  37. package/dist/email-service.mjs.map +1 -0
  38. package/dist/hash.d.mts +59 -0
  39. package/dist/hash.d.ts +59 -0
  40. package/dist/hash.js +95 -0
  41. package/dist/hash.js.map +1 -0
  42. package/dist/hash.mjs +85 -0
  43. package/dist/hash.mjs.map +1 -0
  44. package/dist/index.d.mts +35 -0
  45. package/dist/index.d.ts +35 -0
  46. package/dist/index.js +2697 -2054
  47. package/dist/index.js.map +1 -1
  48. package/dist/index.mjs +2138 -8187
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/keystore-crypto.d.mts +66 -0
  51. package/dist/keystore-crypto.d.ts +66 -0
  52. package/dist/keystore-crypto.js +530 -0
  53. package/dist/keystore-crypto.js.map +1 -0
  54. package/dist/keystore-crypto.mjs +501 -0
  55. package/dist/keystore-crypto.mjs.map +1 -0
  56. package/dist/keystore-service.d.mts +82 -0
  57. package/dist/keystore-service.d.ts +82 -0
  58. package/dist/keystore-service.js +349 -0
  59. package/dist/keystore-service.js.map +1 -0
  60. package/dist/keystore-service.mjs +342 -0
  61. package/dist/keystore-service.mjs.map +1 -0
  62. package/dist/kyber768-B87rMQ7u.d.mts +30 -0
  63. package/dist/kyber768-B87rMQ7u.d.ts +30 -0
  64. package/dist/post-quantum-crypto.d.mts +72 -0
  65. package/dist/post-quantum-crypto.d.ts +72 -0
  66. package/dist/post-quantum-crypto.js +96 -0
  67. package/dist/post-quantum-crypto.js.map +1 -0
  68. package/dist/post-quantum-crypto.mjs +90 -0
  69. package/dist/post-quantum-crypto.mjs.map +1 -0
  70. package/dist/storage-service.d.mts +53 -0
  71. package/dist/storage-service.d.ts +53 -0
  72. package/dist/storage-service.js +70 -0
  73. package/dist/storage-service.js.map +1 -0
  74. package/dist/storage-service.mjs +67 -0
  75. package/dist/storage-service.mjs.map +1 -0
  76. package/dist/symmetric-crypto.d.mts +56 -0
  77. package/dist/symmetric-crypto.d.ts +56 -0
  78. package/dist/symmetric-crypto.js +142 -0
  79. package/dist/symmetric-crypto.js.map +1 -0
  80. package/dist/symmetric-crypto.mjs +134 -0
  81. package/dist/symmetric-crypto.mjs.map +1 -0
  82. package/dist/types.d.mts +102 -0
  83. package/dist/types.d.ts +102 -0
  84. package/dist/types.js +14 -0
  85. package/dist/types.js.map +1 -0
  86. package/dist/types.mjs +12 -0
  87. package/dist/types.mjs.map +1 -0
  88. package/dist/utils-BDaK_d6T.d.ts +114 -0
  89. package/dist/utils-v34IRTIx.d.mts +114 -0
  90. package/dist/utils.d.mts +140 -0
  91. package/dist/utils.d.ts +140 -0
  92. package/dist/utils.js +313 -0
  93. package/dist/utils.js.map +1 -0
  94. package/dist/utils.mjs +273 -0
  95. package/dist/utils.mjs.map +1 -0
  96. package/package.json +83 -7
  97. package/dist/__vite-browser-external-Dyvby5gX.js +0 -2
  98. package/dist/__vite-browser-external-Dyvby5gX.js.map +0 -1
  99. package/dist/__vite-browser-external-l0sNRNKZ.mjs +0 -2
  100. package/dist/__vite-browser-external-l0sNRNKZ.mjs.map +0 -1
@@ -0,0 +1,114 @@
1
+ import { Email, UserWithPublicKeys, PrivateKeys, HybridEncryptedEmail, PublicKeys, PwdProtectedEmail, EmailPublicParameters } from './types.js';
2
+
3
+ /**
4
+ * Encrypts the email using hybrid encryption.
5
+ *
6
+ * @param email - The email to encrypt.
7
+ * @param recipientPublicKeys - The public keys of the recipient.
8
+ * @param senderPrivateKey - The private key of the sender.
9
+ * @returns The encrypted email
10
+ */
11
+ declare function encryptEmailHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail>;
12
+ /**
13
+ * Encrypts the email using hybrid encryption for multiple recipients.
14
+ *
15
+ * @param email - The email to encrypt.
16
+ * @param recipients - The recipients with corresponding public keys.
17
+ * @param senderPrivateKey - The private key of the sender.
18
+ * @returns The set of encrypted email
19
+ */
20
+ declare function encryptEmailHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail[]>;
21
+ /**
22
+ * Decrypts the email using hybrid encryption.
23
+ *
24
+ * @param encryptedEmail - The encrypted email.
25
+ * @param senderPublicKeys - The public key of the sender.
26
+ * @param recipientPrivateKeys - The private key of the recipient.
27
+ * @returns The decrypted email
28
+ */
29
+ declare function decryptEmailHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
30
+
31
+ /**
32
+ * Encrypts the email and its subject using hybrid encryption.
33
+ *
34
+ * @param email - The email to encrypt.
35
+ * @param recipientPublicKeys - The public keys of the recipient.
36
+ * @param senderPrivateKey - The private key of the sender.
37
+ * @returns The encrypted email
38
+ */
39
+ declare function encryptEmailAndSubjectHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail>;
40
+ /**
41
+ * Encrypts the email using hybrid encryption for multiple recipients.
42
+ *
43
+ * @param email - The email to encrypt.
44
+ * @param recipients - The recipients with corresponding public keys.
45
+ * @param senderPrivateKey - The private key of the sender.
46
+ * @returns The set of encrypted email
47
+ */
48
+ declare function encryptEmailAndSubjectHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail[]>;
49
+ /**
50
+ * Decrypts the email using hybrid encryption.
51
+ *
52
+ * @param encryptedEmail - The encrypted email.
53
+ * @param senderPublicKeys - The public key of the sender.
54
+ * @param recipientPrivateKeys - The private key of the recipient.
55
+ * @returns The decrypted email
56
+ */
57
+ declare function decryptEmailAndSubjectHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
58
+
59
+ /**
60
+ * Creates a password-protected email.
61
+ *
62
+ * @param email - The email to password-protect
63
+ * @param password - The secret password shared among recipients.
64
+ * @returns The password-protected email
65
+ */
66
+ declare function createPwdProtectedEmail(email: Email, password: string): Promise<PwdProtectedEmail>;
67
+ /**
68
+ * Opens a password-protected email.
69
+ *
70
+ * @param encryptedEmail - The encrypted email
71
+ * @param password - The secret password shared among recipients.
72
+ * @returns The decrypted email
73
+ */
74
+ declare function decryptPwdProtectedEmail(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
75
+
76
+ /**
77
+ * Creates a password-protected email and its subject.
78
+ *
79
+ * @param email - The email to password-protect
80
+ * @param password - The secret password shared among recipients.
81
+ * @returns The password-protected email with encrypted email subject
82
+ */
83
+ declare function createPwdProtectedEmailAndSubject(email: Email, password: string): Promise<PwdProtectedEmail>;
84
+ /**
85
+ * Opens a password-protected email.
86
+ *
87
+ * @param encryptedEmail - The encrypted email with encrypted email subject.
88
+ * @param password - The secret password shared among recipients.
89
+ * @returns The decrypted email and email subject
90
+ */
91
+ declare function decryptPwdProtectedEmailAndSubject(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
92
+
93
+ /**
94
+ * Creates an auxilary string from public fields of the email.
95
+ *
96
+ * @param params - The email public parameters.
97
+ * @returns The resulting auxilary string
98
+ */
99
+ declare function getAux(params: EmailPublicParameters): string;
100
+ /**
101
+ * Creates an auxilary string from public fields of the email (except for subject field).
102
+ *
103
+ * @param params - The email public parameters.
104
+ * @returns The resulting auxilary string
105
+ */
106
+ declare function getAuxWithoutSubject(params: EmailPublicParameters): string;
107
+ /**
108
+ * Creates a random email ID.
109
+ *
110
+ * @returns The resulting auxilary string
111
+ */
112
+ declare function generateEmailID(): string;
113
+
114
+ export { encryptEmailHybridForMultipleRecipients as a, encryptEmailAndSubjectHybrid as b, encryptEmailAndSubjectHybridForMultipleRecipients as c, decryptEmailHybrid as d, encryptEmailHybrid as e, decryptEmailAndSubjectHybrid as f, createPwdProtectedEmail as g, decryptPwdProtectedEmail as h, createPwdProtectedEmailAndSubject as i, decryptPwdProtectedEmailAndSubject as j, getAux as k, getAuxWithoutSubject as l, generateEmailID as m };
@@ -0,0 +1,114 @@
1
+ import { Email, UserWithPublicKeys, PrivateKeys, HybridEncryptedEmail, PublicKeys, PwdProtectedEmail, EmailPublicParameters } from './types.mjs';
2
+
3
+ /**
4
+ * Encrypts the email using hybrid encryption.
5
+ *
6
+ * @param email - The email to encrypt.
7
+ * @param recipientPublicKeys - The public keys of the recipient.
8
+ * @param senderPrivateKey - The private key of the sender.
9
+ * @returns The encrypted email
10
+ */
11
+ declare function encryptEmailHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail>;
12
+ /**
13
+ * Encrypts the email using hybrid encryption for multiple recipients.
14
+ *
15
+ * @param email - The email to encrypt.
16
+ * @param recipients - The recipients with corresponding public keys.
17
+ * @param senderPrivateKey - The private key of the sender.
18
+ * @returns The set of encrypted email
19
+ */
20
+ declare function encryptEmailHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail[]>;
21
+ /**
22
+ * Decrypts the email using hybrid encryption.
23
+ *
24
+ * @param encryptedEmail - The encrypted email.
25
+ * @param senderPublicKeys - The public key of the sender.
26
+ * @param recipientPrivateKeys - The private key of the recipient.
27
+ * @returns The decrypted email
28
+ */
29
+ declare function decryptEmailHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
30
+
31
+ /**
32
+ * Encrypts the email and its subject using hybrid encryption.
33
+ *
34
+ * @param email - The email to encrypt.
35
+ * @param recipientPublicKeys - The public keys of the recipient.
36
+ * @param senderPrivateKey - The private key of the sender.
37
+ * @returns The encrypted email
38
+ */
39
+ declare function encryptEmailAndSubjectHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail>;
40
+ /**
41
+ * Encrypts the email using hybrid encryption for multiple recipients.
42
+ *
43
+ * @param email - The email to encrypt.
44
+ * @param recipients - The recipients with corresponding public keys.
45
+ * @param senderPrivateKey - The private key of the sender.
46
+ * @returns The set of encrypted email
47
+ */
48
+ declare function encryptEmailAndSubjectHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys): Promise<HybridEncryptedEmail[]>;
49
+ /**
50
+ * Decrypts the email using hybrid encryption.
51
+ *
52
+ * @param encryptedEmail - The encrypted email.
53
+ * @param senderPublicKeys - The public key of the sender.
54
+ * @param recipientPrivateKeys - The private key of the recipient.
55
+ * @returns The decrypted email
56
+ */
57
+ declare function decryptEmailAndSubjectHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
58
+
59
+ /**
60
+ * Creates a password-protected email.
61
+ *
62
+ * @param email - The email to password-protect
63
+ * @param password - The secret password shared among recipients.
64
+ * @returns The password-protected email
65
+ */
66
+ declare function createPwdProtectedEmail(email: Email, password: string): Promise<PwdProtectedEmail>;
67
+ /**
68
+ * Opens a password-protected email.
69
+ *
70
+ * @param encryptedEmail - The encrypted email
71
+ * @param password - The secret password shared among recipients.
72
+ * @returns The decrypted email
73
+ */
74
+ declare function decryptPwdProtectedEmail(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
75
+
76
+ /**
77
+ * Creates a password-protected email and its subject.
78
+ *
79
+ * @param email - The email to password-protect
80
+ * @param password - The secret password shared among recipients.
81
+ * @returns The password-protected email with encrypted email subject
82
+ */
83
+ declare function createPwdProtectedEmailAndSubject(email: Email, password: string): Promise<PwdProtectedEmail>;
84
+ /**
85
+ * Opens a password-protected email.
86
+ *
87
+ * @param encryptedEmail - The encrypted email with encrypted email subject.
88
+ * @param password - The secret password shared among recipients.
89
+ * @returns The decrypted email and email subject
90
+ */
91
+ declare function decryptPwdProtectedEmailAndSubject(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
92
+
93
+ /**
94
+ * Creates an auxilary string from public fields of the email.
95
+ *
96
+ * @param params - The email public parameters.
97
+ * @returns The resulting auxilary string
98
+ */
99
+ declare function getAux(params: EmailPublicParameters): string;
100
+ /**
101
+ * Creates an auxilary string from public fields of the email (except for subject field).
102
+ *
103
+ * @param params - The email public parameters.
104
+ * @returns The resulting auxilary string
105
+ */
106
+ declare function getAuxWithoutSubject(params: EmailPublicParameters): string;
107
+ /**
108
+ * Creates a random email ID.
109
+ *
110
+ * @returns The resulting auxilary string
111
+ */
112
+ declare function generateEmailID(): string;
113
+
114
+ export { encryptEmailHybridForMultipleRecipients as a, encryptEmailAndSubjectHybrid as b, encryptEmailAndSubjectHybridForMultipleRecipients as c, decryptEmailHybrid as d, encryptEmailHybrid as e, decryptEmailAndSubjectHybrid as f, createPwdProtectedEmail as g, decryptPwdProtectedEmail as h, createPwdProtectedEmailAndSubject as i, decryptPwdProtectedEmailAndSubject as j, getAux as k, getAuxWithoutSubject as l, generateEmailID as m };
@@ -0,0 +1,140 @@
1
+ import { IdentityKeys, EncryptionKeys, EncryptedKeystore, MediaKeys, PublicKeys, SymmetricCiphertext } from './types.mjs';
2
+
3
+ /**
4
+ * Converts a Uint8Array into a hexadecimal string.
5
+ *
6
+ * @param array - The Uint8Array to convert.
7
+ * @returns The hexadecimal string representation of the array.
8
+ */
9
+ declare function uint8ArrayToHex(array: Uint8Array): string;
10
+ /**
11
+ * Converts a UTF-8 string into a Uint8Array.
12
+ *
13
+ * @param str - The UTF-8 string to convert.
14
+ * @returns A Uint8Array created from the UTF-8 string.
15
+ */
16
+ declare function UTF8ToUint8(str: string): Uint8Array;
17
+ /**
18
+ * Converts an Uint8Array into a UTF-8 string.
19
+ *
20
+ * @param array - The Uint8Array to convert.
21
+ * @returns The UTF-8 string representation of the array.
22
+ */
23
+ declare function uint8ToUTF8(array: Uint8Array): string;
24
+ /**
25
+ * Converts a hexadecimal string into a Uint8Array.
26
+ *
27
+ * @param hex - The hexadecimal string to convert.
28
+ * @returns A Uint8Array created from the hex string.
29
+ */
30
+ declare function hexToUint8Array(hex: string): Uint8Array;
31
+ /**
32
+ * Converts a Uint8Array into a base64 string.
33
+ *
34
+ * @param array - The Uint8Array to convert.
35
+ * @returns The base64 string representation of the array.
36
+ */
37
+ declare function uint8ArrayToBase64(buffer: Uint8Array): string;
38
+ /**
39
+ * Converts a base64 string into a Uint8Array.
40
+ *
41
+ * @param str - The base64 string to convert.
42
+ * @returns A Uint8Array created from the base64 string.
43
+ */
44
+ declare function base64ToUint8Array(str: string): Uint8Array;
45
+
46
+ /**
47
+ * Converts identity keys to base64
48
+ *
49
+ * @param keys - The identity keys
50
+ * @returns The resulting base64 string
51
+ */
52
+ declare function identityKeysToBase64(keys: IdentityKeys): Promise<string>;
53
+ /**
54
+ * Converts encryption keys to base64
55
+ *
56
+ * @param keys - The encryption keys
57
+ * @returns The resulting base64 string
58
+ */
59
+ declare function encryptionKeysToBase64(keys: EncryptionKeys): Promise<string>;
60
+ /**
61
+ * Converts encrypted keystore to base64
62
+ *
63
+ * @param keystore - The encrypted keystore
64
+ * @returns The resulting base64 string
65
+ */
66
+ declare function encryptedKeystoreToBase64(keystore: EncryptedKeystore): string;
67
+ /**
68
+ * Converts base64 to identity keys
69
+ *
70
+ * @param base64 - The base64 input
71
+ * @returns The resulting idenity keys
72
+ */
73
+ declare function base64ToIdentityKeys(base64: string): Promise<IdentityKeys>;
74
+ /**
75
+ * Converts base64 to encryption keys
76
+ *
77
+ * @param base64 - The base64 input
78
+ * @returns The resulting encryption keys
79
+ */
80
+ declare function base64ToEncryptionKeys(base64: string): Promise<EncryptionKeys>;
81
+ /**
82
+ * Converts base64 to encrypted keystore
83
+ *
84
+ * @param base64 - The base64 input
85
+ * @returns The resulting encrypted keystore
86
+ */
87
+ declare function base64ToEncryptedKeystore(base64: string): EncryptedKeystore;
88
+ /**
89
+ * Converts media keys to base64
90
+ *
91
+ * @param keys - The media keys
92
+ * @returns The resulting base64 string
93
+ */
94
+ declare function mediaKeysToBase64(keys: MediaKeys): string;
95
+ /**
96
+ * Converts base64 to media keys
97
+ *
98
+ * @param base64 - The base64 input
99
+ * @returns The resulting media keys
100
+ */
101
+ declare function base64ToMediaKeys(base64: string): Promise<MediaKeys>;
102
+ /**
103
+ * Converts a base64 string into PublicKeys type.
104
+ *
105
+ * @param base64 - The base64 representation of the public key.
106
+ * @returns The resulting PublicKeys.
107
+ */
108
+ declare function base64ToPublicKey(base64: string): Promise<PublicKeys>;
109
+ /**
110
+ * Converts a PublicKeys type into base64 string.
111
+ *
112
+ * @param key - The PublicKeys key.
113
+ * @returns The resulting base64 string.
114
+ */
115
+ declare function publicKeyToBase64(key: PublicKeys): Promise<string>;
116
+
117
+ /**
118
+ * Converts encrypted message to base64 string
119
+ *
120
+ * @param encryptedMessage - The encrypted message
121
+ * @returns The resulting base64 string.
122
+ */
123
+ declare function ciphertextToBase64(encryptedMessage: SymmetricCiphertext): string;
124
+ /**
125
+ * Converts base64 string to encrypted message
126
+ *
127
+ * @param base64 - The base64 representation of the encrypted message
128
+ * @returns The resulting encrypted message.
129
+ */
130
+ declare function base64ToCiphertext(base64: string): SymmetricCiphertext;
131
+
132
+ /**
133
+ * Generates a mnemonic of required bit strength
134
+ *
135
+ * @param bits - The bit strength.
136
+ * @returns The generated mnemonic.
137
+ */
138
+ declare function genMnemonic(bits: number): string;
139
+
140
+ export { UTF8ToUint8, base64ToCiphertext, base64ToEncryptedKeystore, base64ToEncryptionKeys, base64ToIdentityKeys, base64ToMediaKeys, base64ToPublicKey, base64ToUint8Array, ciphertextToBase64, encryptedKeystoreToBase64, encryptionKeysToBase64, genMnemonic, hexToUint8Array, identityKeysToBase64, mediaKeysToBase64, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8 };
@@ -0,0 +1,140 @@
1
+ import { IdentityKeys, EncryptionKeys, EncryptedKeystore, MediaKeys, PublicKeys, SymmetricCiphertext } from './types.js';
2
+
3
+ /**
4
+ * Converts a Uint8Array into a hexadecimal string.
5
+ *
6
+ * @param array - The Uint8Array to convert.
7
+ * @returns The hexadecimal string representation of the array.
8
+ */
9
+ declare function uint8ArrayToHex(array: Uint8Array): string;
10
+ /**
11
+ * Converts a UTF-8 string into a Uint8Array.
12
+ *
13
+ * @param str - The UTF-8 string to convert.
14
+ * @returns A Uint8Array created from the UTF-8 string.
15
+ */
16
+ declare function UTF8ToUint8(str: string): Uint8Array;
17
+ /**
18
+ * Converts an Uint8Array into a UTF-8 string.
19
+ *
20
+ * @param array - The Uint8Array to convert.
21
+ * @returns The UTF-8 string representation of the array.
22
+ */
23
+ declare function uint8ToUTF8(array: Uint8Array): string;
24
+ /**
25
+ * Converts a hexadecimal string into a Uint8Array.
26
+ *
27
+ * @param hex - The hexadecimal string to convert.
28
+ * @returns A Uint8Array created from the hex string.
29
+ */
30
+ declare function hexToUint8Array(hex: string): Uint8Array;
31
+ /**
32
+ * Converts a Uint8Array into a base64 string.
33
+ *
34
+ * @param array - The Uint8Array to convert.
35
+ * @returns The base64 string representation of the array.
36
+ */
37
+ declare function uint8ArrayToBase64(buffer: Uint8Array): string;
38
+ /**
39
+ * Converts a base64 string into a Uint8Array.
40
+ *
41
+ * @param str - The base64 string to convert.
42
+ * @returns A Uint8Array created from the base64 string.
43
+ */
44
+ declare function base64ToUint8Array(str: string): Uint8Array;
45
+
46
+ /**
47
+ * Converts identity keys to base64
48
+ *
49
+ * @param keys - The identity keys
50
+ * @returns The resulting base64 string
51
+ */
52
+ declare function identityKeysToBase64(keys: IdentityKeys): Promise<string>;
53
+ /**
54
+ * Converts encryption keys to base64
55
+ *
56
+ * @param keys - The encryption keys
57
+ * @returns The resulting base64 string
58
+ */
59
+ declare function encryptionKeysToBase64(keys: EncryptionKeys): Promise<string>;
60
+ /**
61
+ * Converts encrypted keystore to base64
62
+ *
63
+ * @param keystore - The encrypted keystore
64
+ * @returns The resulting base64 string
65
+ */
66
+ declare function encryptedKeystoreToBase64(keystore: EncryptedKeystore): string;
67
+ /**
68
+ * Converts base64 to identity keys
69
+ *
70
+ * @param base64 - The base64 input
71
+ * @returns The resulting idenity keys
72
+ */
73
+ declare function base64ToIdentityKeys(base64: string): Promise<IdentityKeys>;
74
+ /**
75
+ * Converts base64 to encryption keys
76
+ *
77
+ * @param base64 - The base64 input
78
+ * @returns The resulting encryption keys
79
+ */
80
+ declare function base64ToEncryptionKeys(base64: string): Promise<EncryptionKeys>;
81
+ /**
82
+ * Converts base64 to encrypted keystore
83
+ *
84
+ * @param base64 - The base64 input
85
+ * @returns The resulting encrypted keystore
86
+ */
87
+ declare function base64ToEncryptedKeystore(base64: string): EncryptedKeystore;
88
+ /**
89
+ * Converts media keys to base64
90
+ *
91
+ * @param keys - The media keys
92
+ * @returns The resulting base64 string
93
+ */
94
+ declare function mediaKeysToBase64(keys: MediaKeys): string;
95
+ /**
96
+ * Converts base64 to media keys
97
+ *
98
+ * @param base64 - The base64 input
99
+ * @returns The resulting media keys
100
+ */
101
+ declare function base64ToMediaKeys(base64: string): Promise<MediaKeys>;
102
+ /**
103
+ * Converts a base64 string into PublicKeys type.
104
+ *
105
+ * @param base64 - The base64 representation of the public key.
106
+ * @returns The resulting PublicKeys.
107
+ */
108
+ declare function base64ToPublicKey(base64: string): Promise<PublicKeys>;
109
+ /**
110
+ * Converts a PublicKeys type into base64 string.
111
+ *
112
+ * @param key - The PublicKeys key.
113
+ * @returns The resulting base64 string.
114
+ */
115
+ declare function publicKeyToBase64(key: PublicKeys): Promise<string>;
116
+
117
+ /**
118
+ * Converts encrypted message to base64 string
119
+ *
120
+ * @param encryptedMessage - The encrypted message
121
+ * @returns The resulting base64 string.
122
+ */
123
+ declare function ciphertextToBase64(encryptedMessage: SymmetricCiphertext): string;
124
+ /**
125
+ * Converts base64 string to encrypted message
126
+ *
127
+ * @param base64 - The base64 representation of the encrypted message
128
+ * @returns The resulting encrypted message.
129
+ */
130
+ declare function base64ToCiphertext(base64: string): SymmetricCiphertext;
131
+
132
+ /**
133
+ * Generates a mnemonic of required bit strength
134
+ *
135
+ * @param bits - The bit strength.
136
+ * @returns The generated mnemonic.
137
+ */
138
+ declare function genMnemonic(bits: number): string;
139
+
140
+ export { UTF8ToUint8, base64ToCiphertext, base64ToEncryptedKeystore, base64ToEncryptionKeys, base64ToIdentityKeys, base64ToMediaKeys, base64ToPublicKey, base64ToUint8Array, ciphertextToBase64, encryptedKeystoreToBase64, encryptionKeysToBase64, genMnemonic, hexToUint8Array, identityKeysToBase64, mediaKeysToBase64, publicKeyToBase64, uint8ArrayToBase64, uint8ArrayToHex, uint8ToUTF8 };