@immahq/aegis 0.0.6 → 0.0.8

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 (3) hide show
  1. package/README.md +6 -2
  2. package/aegis.d.ts +7 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -71,8 +71,12 @@ const myStorage: StorageAdapter = {
71
71
  };
72
72
 
73
73
  // Initialize the library before any other operation
74
- import { E2EE } from "@immahq/aegis";
75
- const aegis = new E2EE(myStorage);
74
+ import { Aegis, MemoryStorage } from "@immahq/aegis";
75
+ import type {StorageAdapter} from "@immahq/aegis";
76
+
77
+ //Plug in your preferred storage or use MemoryStorage
78
+ //const memory = new MemoryStorage();
79
+ const aegis = new Aegis(myStorage);
76
80
  ```
77
81
 
78
82
  > **Security Note**: The adapter will store secret key material. In production, always use platform-secured storage (e.g., iOS Keychain, Android Keystore, or a securely encrypted database).
package/aegis.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  declare module "@immahq/aegis" {
2
+ export interface Aegis {}
3
+ export interface MemoryStorage extends StorageAdapter {}
4
+
2
5
  export interface Identity {
3
6
  kemKeyPair: { publicKey: Uint8Array; secretKey: Uint8Array };
4
7
  dsaKeyPair: { publicKey: Uint8Array; secretKey: Uint8Array };
@@ -172,23 +175,23 @@ declare module "@immahq/aegis" {
172
175
  name: string,
173
176
  members: string[],
174
177
  memberKemPublicKeys: Map<string, Uint8Array>,
175
- memberDsaPublicKeys: Map<string, Uint8Array>
178
+ memberDsaPublicKeys: Map<string, Uint8Array>,
176
179
  ): Promise<Group>;
177
180
  addMember(
178
181
  groupId: string,
179
182
  userId: string,
180
183
  session: Session,
181
- userPublicKey: Uint8Array
184
+ userPublicKey: Uint8Array,
182
185
  ): Promise<void>;
183
186
  removeMember(groupId: string, userId: string): Promise<void>;
184
187
  updateGroupKey(groupId: string): Promise<void>;
185
188
  encryptMessage(
186
189
  groupId: string,
187
- message: string | Uint8Array
190
+ message: string | Uint8Array,
188
191
  ): Promise<GroupMessage>;
189
192
  decryptMessage(
190
193
  groupId: string,
191
- encrypted: GroupMessage
194
+ encrypted: GroupMessage,
192
195
  ): Promise<Uint8Array>;
193
196
  getGroup(groupId: string): Promise<Group | null>;
194
197
  getGroups(): Promise<Group[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immahq/aegis",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Lightweight, storage-agnostic library for client-side End-to-End (E2E) encryption",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",