@didcid/keymaster 0.3.9 → 0.4.0

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.
@@ -1,5 +1,5 @@
1
1
  import { DidCidDocument, ResolveDIDOptions, Operation, Proof, ProofPurpose } from '@didcid/gatekeeper/types';
2
- import { Challenge, ChallengeResponse, CheckWalletResult, CreateAssetOptions, FileAssetOptions, CreateResponseOptions, DmailItem, DmailMessage, EncryptOptions, FileAsset, FixWalletResult, Group, Vault, VaultOptions, IDInfo, ImageAsset, IssueCredentialsOptions, KeymasterInterface, KeymasterOptions, NoticeMessage, Poll, PossiblyProofed, StoredWallet, VerifiableCredential, ViewPollResult, WalletFile, WalletEncFile } from '@didcid/keymaster/types';
2
+ import { Challenge, ChallengeResponse, CheckWalletResult, CreateAssetOptions, FileAssetOptions, CreateResponseOptions, DmailItem, DmailMessage, EncryptOptions, FileAsset, FixWalletResult, Group, Vault, VaultOptions, IDInfo, ImageFileAsset, IssueCredentialsOptions, KeymasterInterface, KeymasterOptions, NoticeMessage, PollConfig, PossiblyProofed, ViewBallotResult, StoredWallet, VerifiableCredential, ViewPollResult, WalletFile, WalletEncFile } from '@didcid/keymaster/types';
3
3
  import { EcdsaJwkPair, EcdsaJwkPublic } from '@didcid/cipher/types';
4
4
  export declare enum DmailTags {
5
5
  DMAIL = "dmail",
@@ -16,6 +16,10 @@ export declare enum NoticeTags {
16
16
  POLL = "poll",
17
17
  CREDENTIAL = "credential"
18
18
  }
19
+ export declare enum PollItems {
20
+ POLL = "poll",
21
+ RESULTS = "results"
22
+ }
19
23
  export default class Keymaster implements KeymasterInterface {
20
24
  private readonly passphrase;
21
25
  private gatekeeper;
@@ -51,17 +55,17 @@ export default class Keymaster implements KeymasterInterface {
51
55
  fetchKeyPair(name?: string): Promise<EcdsaJwkPair | null>;
52
56
  createAsset(data: unknown, options?: CreateAssetOptions): Promise<string>;
53
57
  cloneAsset(id: string, options?: CreateAssetOptions): Promise<string>;
54
- generateImageAsset(buffer: Buffer): Promise<ImageAsset>;
55
- createImage(buffer: Buffer, options?: CreateAssetOptions): Promise<string>;
56
- updateImage(id: string, buffer: Buffer): Promise<boolean>;
57
- getImage(id: string): Promise<ImageAsset | null>;
58
+ generateImageAsset(filename: string, buffer: Buffer): Promise<ImageFileAsset>;
59
+ createImage(buffer: Buffer, options?: FileAssetOptions): Promise<string>;
60
+ updateImage(id: string, buffer: Buffer, options?: FileAssetOptions): Promise<boolean>;
61
+ getImage(id: string): Promise<ImageFileAsset | null>;
58
62
  testImage(id: string): Promise<boolean>;
59
63
  getMimeType(buffer: Buffer): Promise<string>;
60
64
  generateFileAsset(filename: string, buffer: Buffer): Promise<FileAsset>;
61
- createDocument(buffer: Buffer, options?: FileAssetOptions): Promise<string>;
62
- updateDocument(id: string, buffer: Buffer, options?: FileAssetOptions): Promise<boolean>;
63
- getDocument(id: string): Promise<FileAsset | null>;
64
- testDocument(id: string): Promise<boolean>;
65
+ createFile(buffer: Buffer, options?: FileAssetOptions): Promise<string>;
66
+ updateFile(id: string, buffer: Buffer, options?: FileAssetOptions): Promise<boolean>;
67
+ getFile(id: string): Promise<FileAsset | null>;
68
+ testFile(id: string): Promise<boolean>;
65
69
  encryptMessage(msg: string, receiver: string, options?: EncryptOptions): Promise<string>;
66
70
  private decryptWithDerivedKeys;
67
71
  decryptMessage(did: string): Promise<string>;
@@ -111,6 +115,7 @@ export default class Keymaster implements KeymasterInterface {
111
115
  }): Promise<VerifiableCredential>;
112
116
  issueCredential(credential: Partial<VerifiableCredential>, options?: IssueCredentialsOptions): Promise<string>;
113
117
  sendCredential(did: string, options?: CreateAssetOptions): Promise<string | null>;
118
+ private isManagedDID;
114
119
  private isVerifiableCredential;
115
120
  updateCredential(did: string, credential: VerifiableCredential): Promise<boolean>;
116
121
  revokeCredential(credential: string): Promise<boolean>;
@@ -144,17 +149,23 @@ export default class Keymaster implements KeymasterInterface {
144
149
  testSchema(id: string): Promise<boolean>;
145
150
  listSchemas(owner?: string): Promise<string[]>;
146
151
  createTemplate(schemaId: string): Promise<Record<string, unknown>>;
147
- pollTemplate(): Promise<Poll>;
148
- createPoll(poll: Poll, options?: CreateAssetOptions): Promise<string>;
149
- getPoll(id: string): Promise<Poll | null>;
152
+ pollTemplate(): Promise<PollConfig>;
153
+ createPoll(config: PollConfig, options?: VaultOptions): Promise<string>;
154
+ getPoll(id: string): Promise<PollConfig | null>;
150
155
  testPoll(id: string): Promise<boolean>;
151
156
  listPolls(owner?: string): Promise<string[]>;
157
+ addPollVoter(pollId: string, memberId: string): Promise<boolean>;
158
+ removePollVoter(pollId: string, memberId: string): Promise<boolean>;
159
+ listPollVoters(pollId: string): Promise<Record<string, any>>;
152
160
  viewPoll(pollId: string): Promise<ViewPollResult>;
161
+ private computePollResults;
153
162
  votePoll(pollId: string, vote: number, options?: {
154
- spoil?: boolean;
155
163
  registry?: string;
156
164
  validUntil?: string;
157
165
  }): Promise<string>;
166
+ sendPoll(pollId: string): Promise<string>;
167
+ sendBallot(ballotDid: string, pollId: string): Promise<string>;
168
+ viewBallot(ballotDid: string): Promise<ViewBallotResult>;
158
169
  updatePoll(ballot: string): Promise<boolean>;
159
170
  publishPoll(pollId: string, options?: {
160
171
  reveal?: boolean;
@@ -163,6 +174,7 @@ export default class Keymaster implements KeymasterInterface {
163
174
  createVault(options?: VaultOptions): Promise<string>;
164
175
  getVault(vaultId: string, options?: ResolveDIDOptions): Promise<Vault>;
165
176
  testVault(id: string, options?: ResolveDIDOptions): Promise<boolean>;
177
+ private generateBallotKey;
166
178
  private generateSaltedId;
167
179
  private decryptVault;
168
180
  private checkVaultOwner;
@@ -115,11 +115,10 @@ export interface PollResults {
115
115
  count: number;
116
116
  }>;
117
117
  ballots?: Array<{
118
- ballot: string;
119
- received: string;
120
118
  voter: string;
121
119
  vote: number;
122
120
  option: string;
121
+ received: string;
123
122
  }>;
124
123
  votes?: {
125
124
  eligible: number;
@@ -128,18 +127,12 @@ export interface PollResults {
128
127
  };
129
128
  final?: boolean;
130
129
  }
131
- export interface Poll {
132
- type: string;
133
- version: number;
130
+ export interface PollConfig {
131
+ version: 2;
132
+ name: string;
134
133
  description: string;
135
- roster: string;
136
134
  options: string[];
137
135
  deadline: string;
138
- ballots?: Record<string, {
139
- ballot: string;
140
- received: string;
141
- }>;
142
- results?: PollResults;
143
136
  }
144
137
  export interface ViewPollResult {
145
138
  description: string;
@@ -149,21 +142,32 @@ export interface ViewPollResult {
149
142
  isEligible: boolean;
150
143
  voteExpired: boolean;
151
144
  hasVoted: boolean;
145
+ ballots?: string[];
152
146
  results?: PollResults;
153
147
  }
148
+ export interface ViewBallotResult {
149
+ poll: string;
150
+ voter?: string;
151
+ vote?: number;
152
+ option?: string;
153
+ }
154
154
  export interface BinaryAsset {
155
155
  cid: string;
156
156
  type: string;
157
157
  bytes: number;
158
158
  data?: Buffer;
159
159
  }
160
- export interface ImageAsset extends BinaryAsset {
160
+ export interface ImageAsset {
161
161
  width: number;
162
162
  height: number;
163
163
  }
164
164
  export interface FileAsset extends BinaryAsset {
165
165
  filename: string;
166
166
  }
167
+ export interface ImageFileAsset {
168
+ file: FileAsset;
169
+ image: ImageAsset;
170
+ }
167
171
  export interface Vault {
168
172
  version?: number;
169
173
  publicJwk: EcdsaJwkPublic;
@@ -198,8 +202,8 @@ export interface KeymasterOptions {
198
202
  maxAliasLength?: number;
199
203
  }
200
204
  export interface EncryptedMessage {
201
- sender: string;
202
- created: string;
205
+ sender?: string;
206
+ created?: string;
203
207
  cipher_hash?: string | null;
204
208
  cipher_sender?: string | null;
205
209
  cipher_receiver?: string | null;
@@ -320,28 +324,35 @@ export interface KeymasterInterface {
320
324
  retries?: number;
321
325
  delay?: number;
322
326
  }): Promise<ChallengeResponse>;
323
- pollTemplate(): Promise<Poll>;
324
- createPoll(poll: Poll, options?: CreateAssetOptions): Promise<string>;
325
- getPoll(pollId: string): Promise<Poll | null>;
327
+ pollTemplate(): Promise<PollConfig>;
328
+ createPoll(config: PollConfig, options?: VaultOptions): Promise<string>;
329
+ getPoll(pollId: string): Promise<PollConfig | null>;
330
+ testPoll(id: string): Promise<boolean>;
331
+ listPolls(owner?: string): Promise<string[]>;
326
332
  viewPoll(pollId: string): Promise<ViewPollResult>;
327
333
  votePoll(pollId: string, vote: number, options?: {
328
- spoil?: boolean;
329
334
  registry?: string;
330
335
  validUntil?: string;
331
336
  }): Promise<string>;
337
+ sendPoll(pollId: string): Promise<string>;
338
+ sendBallot(ballotDid: string, pollId: string): Promise<string>;
339
+ viewBallot(ballotDid: string): Promise<ViewBallotResult>;
332
340
  updatePoll(ballot: string): Promise<boolean>;
333
341
  publishPoll(pollId: string, options?: {
334
342
  reveal?: boolean;
335
343
  }): Promise<boolean>;
336
344
  unpublishPoll(pollId: string): Promise<boolean>;
337
- createImage(data: Buffer, options?: CreateAssetOptions): Promise<string>;
338
- updateImage(did: string, data: Buffer): Promise<boolean>;
339
- getImage(id: string): Promise<ImageAsset | null>;
345
+ addPollVoter(pollId: string, memberId: string): Promise<boolean>;
346
+ removePollVoter(pollId: string, memberId: string): Promise<boolean>;
347
+ listPollVoters(pollId: string): Promise<Record<string, any>>;
348
+ createImage(data: Buffer, options?: FileAssetOptions): Promise<string>;
349
+ updateImage(did: string, data: Buffer, options?: FileAssetOptions): Promise<boolean>;
350
+ getImage(id: string): Promise<ImageFileAsset | null>;
340
351
  testImage(id: string): Promise<boolean>;
341
- createDocument(data: Buffer, options?: FileAssetOptions): Promise<string>;
342
- updateDocument(did: string, data: Buffer, options?: FileAssetOptions): Promise<boolean>;
343
- getDocument(id: string): Promise<FileAsset | null>;
344
- testDocument(id: string): Promise<boolean>;
352
+ createFile(data: Buffer, options?: FileAssetOptions): Promise<string>;
353
+ updateFile(did: string, data: Buffer, options?: FileAssetOptions): Promise<boolean>;
354
+ getFile(id: string): Promise<FileAsset | null>;
355
+ testFile(id: string): Promise<boolean>;
345
356
  createVault(options?: VaultOptions): Promise<string>;
346
357
  getVault(vaultId: string, options?: ResolveDIDOptions): Promise<Vault>;
347
358
  testVault(vaultId: string, options?: ResolveDIDOptions): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didcid/keymaster",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "Archon Keymaster",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",
@@ -37,11 +37,6 @@
37
37
  "require": "./dist/cjs/keymaster-client.cjs",
38
38
  "types": "./dist/types/keymaster-client.d.ts"
39
39
  },
40
- "./encryption": {
41
- "import": "./dist/esm/encryption.js",
42
- "require": "./dist/cjs/encryption.cjs",
43
- "types": "./dist/types/encryption.d.ts"
44
- },
45
40
  "./wallet/json": {
46
41
  "import": "./dist/esm/db/json.js",
47
42
  "require": "./dist/cjs/db/json.cjs",
@@ -101,9 +96,6 @@
101
96
  "client": [
102
97
  "./dist/types/keymaster-client.d.ts"
103
98
  ],
104
- "encryption": [
105
- "./dist/types/encryption.d.ts"
106
- ],
107
99
  "wallet/json": [
108
100
  "./dist/types/db/json.d.ts"
109
101
  ],
@@ -149,9 +141,9 @@
149
141
  "author": "David McFadzean <davidmc@gmail.com>",
150
142
  "license": "MIT",
151
143
  "dependencies": {
152
- "@didcid/cipher": "^0.1.3",
144
+ "@didcid/cipher": "^0.2.0",
153
145
  "@didcid/common": "^0.1.3",
154
- "@didcid/gatekeeper": "^0.3.6",
146
+ "@didcid/gatekeeper": "^0.4.0",
155
147
  "axios": "^1.7.7",
156
148
  "commander": "^11.1.0",
157
149
  "dotenv": "^16.4.5",
@@ -166,5 +158,5 @@
166
158
  "type": "git",
167
159
  "url": "git+https://github.com/archetech/archon.git"
168
160
  },
169
- "gitHead": "2f8305e87026fc82787fabb06d6dab419e77679b"
161
+ "gitHead": "4692cc18e1377cafc96aaf7a55cd969a0b09b77c"
170
162
  }
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- const ENC_ALG = 'AES-GCM';
4
- const ENC_KDF = 'PBKDF2';
5
- const ENC_HASH = 'SHA-512';
6
- const ENC_ITER_DEFAULT = 100_000;
7
- const IV_LEN = 12;
8
- const SALT_LEN = 16;
9
- function getIterations() {
10
- if (typeof process !== 'undefined' && process.env?.PBKDF2_ITERATIONS) {
11
- const parsed = parseInt(process.env.PBKDF2_ITERATIONS, 10);
12
- if (!isNaN(parsed) && parsed > 0) {
13
- return parsed;
14
- }
15
- }
16
- return ENC_ITER_DEFAULT;
17
- }
18
- async function encMnemonic(mnemonic, pass) {
19
- if (!hasSubtle()) {
20
- throw new Error('Web Cryptography API not available');
21
- }
22
- const salt = await randBytes(SALT_LEN);
23
- const iv = await randBytes(IV_LEN);
24
- const key = await deriveKey(pass, salt);
25
- const ct = await crypto.subtle.encrypt({ name: ENC_ALG, iv: iv }, key, new TextEncoder().encode(mnemonic));
26
- return { salt: b64(salt), iv: b64(iv), data: b64(new Uint8Array(ct)) };
27
- }
28
- async function decMnemonic(blob, pass) {
29
- if (!hasSubtle()) {
30
- throw new Error('Web Cryptography API not available');
31
- }
32
- const salt = ub64(blob.salt);
33
- const iv = ub64(blob.iv);
34
- const data = ub64(blob.data);
35
- const key = await deriveKey(pass, salt);
36
- const pt = await crypto.subtle.decrypt({ name: ENC_ALG, iv }, key, data);
37
- return new TextDecoder().decode(pt);
38
- }
39
- const b64 = (buf) => {
40
- return Buffer.from(buf).toString('base64');
41
- };
42
- const ub64 = (b64) => {
43
- return new Uint8Array(Buffer.from(b64, 'base64'));
44
- };
45
- const hasSubtle = () => typeof globalThis !== 'undefined' &&
46
- !!(globalThis.crypto && globalThis.crypto.subtle);
47
- async function randBytes(len) {
48
- const u8 = new Uint8Array(len);
49
- crypto.getRandomValues(u8);
50
- return u8;
51
- }
52
- async function deriveKey(pass, salt) {
53
- const enc = new TextEncoder();
54
- const passKey = await crypto.subtle.importKey('raw', enc.encode(pass), { name: ENC_KDF }, false, ['deriveKey']);
55
- return crypto.subtle.deriveKey({ name: ENC_KDF, salt: salt, iterations: getIterations(), hash: ENC_HASH }, passKey, { name: ENC_ALG, length: 256 }, false, ['encrypt', 'decrypt']);
56
- }
57
-
58
- exports.decMnemonic = decMnemonic;
59
- exports.encMnemonic = encMnemonic;
@@ -1,55 +0,0 @@
1
- const ENC_ALG = 'AES-GCM';
2
- const ENC_KDF = 'PBKDF2';
3
- const ENC_HASH = 'SHA-512';
4
- const ENC_ITER_DEFAULT = 100_000;
5
- const IV_LEN = 12;
6
- const SALT_LEN = 16;
7
- function getIterations() {
8
- if (typeof process !== 'undefined' && process.env?.PBKDF2_ITERATIONS) {
9
- const parsed = parseInt(process.env.PBKDF2_ITERATIONS, 10);
10
- if (!isNaN(parsed) && parsed > 0) {
11
- return parsed;
12
- }
13
- }
14
- return ENC_ITER_DEFAULT;
15
- }
16
- export async function encMnemonic(mnemonic, pass) {
17
- if (!hasSubtle()) {
18
- throw new Error('Web Cryptography API not available');
19
- }
20
- const salt = await randBytes(SALT_LEN);
21
- const iv = await randBytes(IV_LEN);
22
- const key = await deriveKey(pass, salt);
23
- const ct = await crypto.subtle.encrypt({ name: ENC_ALG, iv: iv }, key, new TextEncoder().encode(mnemonic));
24
- return { salt: b64(salt), iv: b64(iv), data: b64(new Uint8Array(ct)) };
25
- }
26
- export async function decMnemonic(blob, pass) {
27
- if (!hasSubtle()) {
28
- throw new Error('Web Cryptography API not available');
29
- }
30
- const salt = ub64(blob.salt);
31
- const iv = ub64(blob.iv);
32
- const data = ub64(blob.data);
33
- const key = await deriveKey(pass, salt);
34
- const pt = await crypto.subtle.decrypt({ name: ENC_ALG, iv }, key, data);
35
- return new TextDecoder().decode(pt);
36
- }
37
- const b64 = (buf) => {
38
- return Buffer.from(buf).toString('base64');
39
- };
40
- const ub64 = (b64) => {
41
- return new Uint8Array(Buffer.from(b64, 'base64'));
42
- };
43
- const hasSubtle = () => typeof globalThis !== 'undefined' &&
44
- !!(globalThis.crypto && globalThis.crypto.subtle);
45
- async function randBytes(len) {
46
- const u8 = new Uint8Array(len);
47
- crypto.getRandomValues(u8);
48
- return u8;
49
- }
50
- async function deriveKey(pass, salt) {
51
- const enc = new TextEncoder();
52
- const passKey = await crypto.subtle.importKey('raw', enc.encode(pass), { name: ENC_KDF }, false, ['deriveKey']);
53
- return crypto.subtle.deriveKey({ name: ENC_KDF, salt: salt, iterations: getIterations(), hash: ENC_HASH }, passKey, { name: ENC_ALG, length: 256 }, false, ['encrypt', 'decrypt']);
54
- }
55
- //# sourceMappingURL=encryption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encryption.js","sourceRoot":"","sources":["../../src/encryption.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,OAAO,GAAG,QAAQ,CAAC;AACzB,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,SAAS,aAAa;IAClB,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,iBAAiB,EAAE,CAAC;QACnE,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,OAAO,MAAM,CAAC;QAClB,CAAC;IACL,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB,EAAE,IAAY;IAC5D,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;IAE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;
6
- export declare function decMnemonic(blob: {
7
- salt: string;
8
- iv: string;
9
- data: string;
10
- }, pass: string): Promise<string>;