signify-ts 0.2.0 → 0.3.0-dev.e31e78d

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 (129) hide show
  1. package/README.md +104 -34
  2. package/dist/exports.d.ts +40 -40
  3. package/dist/exports.js +40 -0
  4. package/dist/index.d.ts +2 -3
  5. package/dist/index.js +3 -8
  6. package/dist/keri/app/aiding.d.ts +54 -18
  7. package/{src/keri/app/aiding.ts → dist/keri/app/aiding.js} +130 -236
  8. package/dist/keri/app/clienting.d.ts +59 -22
  9. package/{src/keri/app/clienting.ts → dist/keri/app/clienting.js} +146 -235
  10. package/dist/keri/app/contacting.d.ts +30 -23
  11. package/{src/keri/app/contacting.ts → dist/keri/app/contacting.js} +26 -63
  12. package/dist/keri/app/controller.d.ts +49 -6
  13. package/{src/keri/app/controller.ts → dist/keri/app/controller.js} +80 -186
  14. package/dist/keri/app/coring.d.ts +134 -25
  15. package/{src/keri/app/coring.ts → dist/keri/app/coring.js} +83 -56
  16. package/dist/keri/app/credentialing.d.ts +191 -67
  17. package/dist/keri/app/credentialing.js +540 -0
  18. package/dist/keri/app/delegating.d.ts +18 -0
  19. package/dist/keri/app/delegating.js +24 -0
  20. package/dist/keri/app/escrowing.d.ts +5 -3
  21. package/{src/keri/app/escrowing.ts → dist/keri/app/escrowing.js} +3 -9
  22. package/dist/keri/app/exchanging.d.ts +243 -11
  23. package/dist/keri/app/exchanging.js +242 -0
  24. package/dist/keri/app/grouping.d.ts +11 -9
  25. package/{src/keri/app/grouping.ts → dist/keri/app/grouping.js} +10 -29
  26. package/dist/keri/app/habery.d.ts +2 -2
  27. package/dist/keri/app/habery.js +117 -0
  28. package/dist/keri/app/notifying.d.ts +2 -2
  29. package/{src/keri/app/notifying.ts → dist/keri/app/notifying.js} +7 -17
  30. package/dist/keri/core/authing.d.ts +2 -2
  31. package/{src/keri/core/authing.ts → dist/keri/core/authing.js} +26 -42
  32. package/dist/keri/core/base64.d.ts +2 -0
  33. package/dist/keri/core/base64.js +16 -0
  34. package/dist/keri/core/bexter.d.ts +1 -1
  35. package/{src/keri/core/bexter.ts → dist/keri/core/bexter.js} +18 -32
  36. package/dist/keri/core/cigar.d.ts +2 -2
  37. package/dist/keri/core/cigar.js +13 -0
  38. package/dist/keri/core/cipher.d.ts +1 -1
  39. package/{src/keri/core/cipher.ts → dist/keri/core/cipher.js} +10 -19
  40. package/dist/keri/core/core.d.ts +117 -9
  41. package/dist/keri/core/core.js +385 -0
  42. package/dist/keri/core/counter.d.ts +2 -2
  43. package/dist/keri/core/counter.js +221 -0
  44. package/dist/keri/core/decrypter.d.ts +4 -4
  45. package/{src/keri/core/decrypter.ts → dist/keri/core/decrypter.js} +23 -40
  46. package/dist/keri/core/diger.d.ts +3 -3
  47. package/{src/keri/core/diger.ts → dist/keri/core/diger.js} +18 -33
  48. package/dist/keri/core/encrypter.d.ts +2 -2
  49. package/{src/keri/core/encrypter.ts → dist/keri/core/encrypter.js} +18 -38
  50. package/dist/keri/core/eventing.d.ts +6 -6
  51. package/dist/keri/core/eventing.js +383 -0
  52. package/dist/keri/core/httping.d.ts +11 -4
  53. package/{src/keri/core/httping.ts → dist/keri/core/httping.js} +36 -101
  54. package/dist/keri/core/indexer.d.ts +1 -1
  55. package/dist/keri/core/indexer.js +407 -0
  56. package/dist/keri/core/keeping.d.ts +113 -46
  57. package/dist/keri/core/keeping.js +347 -0
  58. package/{src/keri/core/kering.ts → dist/keri/core/kering.js} +1 -3
  59. package/dist/keri/core/keyState.d.ts +98 -0
  60. package/dist/keri/core/manager.d.ts +147 -12
  61. package/dist/keri/core/manager.js +880 -0
  62. package/dist/keri/core/matter.d.ts +1 -1
  63. package/dist/keri/core/matter.js +460 -0
  64. package/dist/keri/core/number.d.ts +2 -2
  65. package/{src/keri/core/number.ts → dist/keri/core/number.js} +26 -32
  66. package/dist/keri/core/pather.d.ts +2 -2
  67. package/{src/keri/core/pather.ts → dist/keri/core/pather.js} +12 -27
  68. package/dist/keri/core/prefixer.d.ts +10 -10
  69. package/dist/keri/core/prefixer.js +182 -0
  70. package/dist/keri/core/saider.d.ts +2 -12
  71. package/dist/keri/core/saider.js +107 -0
  72. package/dist/keri/core/salter.d.ts +44 -9
  73. package/dist/keri/core/salter.js +110 -0
  74. package/dist/keri/core/seqner.d.ts +1 -1
  75. package/{src/keri/core/seqner.ts → dist/keri/core/seqner.js} +20 -21
  76. package/dist/keri/core/serder.d.ts +25 -12
  77. package/dist/keri/core/serder.js +133 -0
  78. package/dist/keri/core/siger.d.ts +2 -2
  79. package/{src/keri/core/siger.ts → dist/keri/core/siger.js} +4 -14
  80. package/dist/keri/core/signer.d.ts +4 -4
  81. package/dist/keri/core/signer.js +84 -0
  82. package/{src/keri/core/tholder.ts → dist/keri/core/tholder.js} +69 -94
  83. package/dist/keri/core/utils.d.ts +1 -1
  84. package/{src/keri/core/utils.ts → dist/keri/core/utils.js} +30 -60
  85. package/dist/keri/core/vdring.d.ts +2 -2
  86. package/dist/keri/core/vdring.js +61 -0
  87. package/dist/keri/core/verfer.d.ts +2 -6
  88. package/dist/keri/core/verfer.js +37 -0
  89. package/dist/keri/end/ending.d.ts +10 -8
  90. package/dist/keri/end/ending.js +136 -0
  91. package/{src/ready.ts → dist/ready.js} +1 -2
  92. package/dist/types/keria-api-schema.d.ts +1158 -0
  93. package/dist/types/keria-api-schema.js +34 -0
  94. package/package.json +53 -52
  95. package/dist/math.d.ts +0 -1
  96. package/dist/signify-ts.cjs +0 -7835
  97. package/dist/signify-ts.cjs.development.js +0 -9501
  98. package/dist/signify-ts.cjs.development.js.map +0 -1
  99. package/dist/signify-ts.cjs.map +0 -7
  100. package/dist/signify-ts.cjs.production.min.js +0 -2
  101. package/dist/signify-ts.cjs.production.min.js.map +0 -1
  102. package/dist/signify-ts.esm.js +0 -9345
  103. package/dist/signify-ts.esm.js.map +0 -1
  104. package/dist/signify-ts.mjs +0 -7811
  105. package/dist/signify-ts.mjs.map +0 -7
  106. package/src/buffer-polyfill.ts +0 -5
  107. package/src/exports.ts +0 -44
  108. package/src/index.ts +0 -4
  109. package/src/keri/app/credentialing.ts +0 -820
  110. package/src/keri/app/exchanging.ts +0 -220
  111. package/src/keri/app/habery.ts +0 -185
  112. package/src/keri/core/cigar.ts +0 -18
  113. package/src/keri/core/core.ts +0 -326
  114. package/src/keri/core/counter.ts +0 -273
  115. package/src/keri/core/eventing.ts +0 -581
  116. package/src/keri/core/indexer.ts +0 -509
  117. package/src/keri/core/keeping.ts +0 -684
  118. package/src/keri/core/manager.ts +0 -1183
  119. package/src/keri/core/matter.ts +0 -521
  120. package/src/keri/core/prefixer.ts +0 -233
  121. package/src/keri/core/saider.ts +0 -186
  122. package/src/keri/core/salter.ts +0 -120
  123. package/src/keri/core/serder.ts +0 -163
  124. package/src/keri/core/signer.ts +0 -133
  125. package/src/keri/core/vdring.ts +0 -94
  126. package/src/keri/core/verfer.ts +0 -47
  127. package/src/keri/end/ending.ts +0 -170
  128. package/src/math.ts +0 -3
  129. /package/dist/{buffer-polyfill.d.ts → keri/core/keyState.js} +0 -0
@@ -1,42 +1,123 @@
1
- import { Encrypter } from './encrypter';
2
- import { Decrypter } from './decrypter';
3
- import { Salter, Tier } from './salter';
4
- import { Signer } from './signer';
5
- import { Verfer } from './verfer';
6
- import { Diger } from './diger';
7
- import { Cigar } from './cigar';
8
- import { Siger } from './siger';
1
+ import { Encrypter } from './encrypter.ts';
2
+ import { Decrypter } from './decrypter.ts';
3
+ import { Salter, Tier } from './salter.ts';
4
+ import { Signer } from './signer.ts';
5
+ import { Verfer } from './verfer.ts';
6
+ import { Diger } from './diger.ts';
7
+ import { Cigar } from './cigar.ts';
8
+ import { Siger } from './siger.ts';
9
+ /**
10
+ * Kinds of key pair generation algorithms.
11
+ * Salty is deterministic based on a salt and stem.
12
+ * Randy is random.
13
+ * Group is a multi-signature group algorithm indicating keys are retrieved from a group member which will be either Salty or Randy.
14
+ * Extern is an external key pair algorithm indicating keys are provided by an external source such as an HSM.
15
+ */
9
16
  export declare enum Algos {
10
17
  randy = "randy",
11
18
  salty = "salty",
12
19
  group = "group",
13
20
  extern = "extern"
14
21
  }
22
+ /**
23
+ * Lot (set) of public keys as an ordered list with indexes and the time created.
24
+ * Indexes refer to the index of the ordered sequence of keys in an establishment event (inception or rotation).
25
+ * Assumes the same length for each set of keys across all PubLot instances used for a given identifier.
26
+ */
15
27
  declare class PubLot {
28
+ /**
29
+ * List of fully qualified, Base64 encoded public keys. Defaults to empty.
30
+ */
16
31
  pubs: Array<string>;
32
+ /**
33
+ * Rotation index; index of rotation (est event) that uses this public key set.
34
+ * The index of the key set for an inception event is 0.
35
+ */
17
36
  ridx: number;
37
+ /**
38
+ * Key index; index of the starting key in the key set for this lot in sequence
39
+ * with reference to all public keys for the identifier.
40
+ * For example, if each set (PubLot.pubs) has 3 keys then ridx 2 has kidx of 2*3 = 6.
41
+ * Defaults to 0.
42
+ */
18
43
  kidx: number;
44
+ /**
45
+ * Datetime of when key set created formatted as an ISO 8601 compliant string.
46
+ */
19
47
  dt: string;
20
48
  }
49
+ /**
50
+ * Prefix's public key situation (set of public keys).
51
+ */
21
52
  declare class PreSit {
53
+ /**
54
+ * Previous publot; previous public key set.
55
+ */
22
56
  old: PubLot;
57
+ /**
58
+ * New, current publot; current public key set.
59
+ */
23
60
  new: PubLot;
61
+ /**
62
+ * Next public publot
63
+ */
24
64
  nxt: PubLot;
25
65
  }
66
+ /**
67
+ * Identifier prefix parameters for creating new key pairs.
68
+ */
26
69
  declare class PrePrm {
70
+ /**
71
+ * Prefix index for this keypair sequence.
72
+ */
27
73
  pidx: number;
74
+ /**
75
+ * Key generation algorithm type.
76
+ * Defaults to Salty.
77
+ * Salty default uses indices and salt to create new key pairs.
78
+ */
28
79
  algo: Algos;
80
+ /**
81
+ * Used for salty algo. Defaults to empty. Unused for randy algo.
82
+ */
29
83
  salt: string;
84
+ /**
85
+ * Default unique path prefix used by the salty algo during key generation.
86
+ */
30
87
  stem: string;
88
+ /**
89
+ * Security tier for stretch index; used by the salty algo.
90
+ */
31
91
  tier: string;
32
92
  }
93
+ /**
94
+ * An identifier prefix's public key set (list) at a given rotation index ridx.
95
+ */
33
96
  declare class PubSet {
97
+ /**
98
+ * List of fully qualified, Base64 encoded public keys.
99
+ */
34
100
  pubs: Array<string>;
35
101
  }
102
+ /**
103
+ * Describes a path to a specific derived keypair for a given identifier
104
+ */
36
105
  declare class PubPath {
106
+ /**
107
+ * The path to a specific keypair. To generate a keypair you combine the path with the salt and tier.
108
+ */
37
109
  path: string;
110
+ /**
111
+ * Derivation code indicating the kind of cryptographic keypair to generate. Defaults to Ed25519.
112
+ */
38
113
  code: string;
114
+ /**
115
+ * Security tier to use to generate a keypair. Defaults to high.
116
+ */
39
117
  tier: string;
118
+ /**
119
+ * Flag to control whether to generate a low security, temporary key. Used for speed for unit tests. Do NOT use for production identifiers.
120
+ */
40
121
  temp: boolean;
41
122
  }
42
123
  declare class Keys {
@@ -46,20 +127,65 @@ declare class Keys {
46
127
  get paths(): Array<string> | undefined;
47
128
  get signers(): Array<Signer>;
48
129
  }
130
+ /**
131
+ * Interface for creating a key pair based on an algorithm.
132
+ */
49
133
  export interface Creator {
134
+ /**
135
+ * Creates a key pair
136
+ * @param codes list of derivation codes one per key pair to create
137
+ * @param count count of key pairs to create if codes not provided
138
+ * @param code derivation code to use for count key pairs if codes not provided
139
+ * @param transferable true means use transferable derivation code. Otherwise, non-transferable derivation code.
140
+ * @param pidx prefix index for this keypair sequence
141
+ * @param ridx rotation index for this key pair set
142
+ * @param kidx starting key index for this key pair set
143
+ * @param temp true means use temp stretch otherwise use time set by tier for streching
144
+ */
50
145
  create(codes: Array<string> | undefined, count: number, code: string, transferable: boolean, pidx: number, ridx: number, kidx: number, temp: boolean): Keys;
146
+ /**
147
+ * Salt used for key pair generation.
148
+ * Used only for Salty key creation.
149
+ */
51
150
  salt: string;
151
+ /**
152
+ * String prefix used to stretch the prefix, salt, and seed into the key pair.
153
+ * Used only for Salty key creation.
154
+ */
52
155
  stem: string;
156
+ /**
157
+ * Security tier used during stretching.
158
+ */
53
159
  tier: Tier;
54
160
  }
55
161
  export declare class RandyCreator implements Creator {
56
162
  create(codes?: Array<string> | undefined, count?: number, code?: string, transferable?: boolean): Keys;
163
+ /**
164
+ * Unused for random key generation.
165
+ */
57
166
  get salt(): string;
167
+ /**
168
+ * Unused for random key generation.
169
+ */
58
170
  get stem(): string;
171
+ /**
172
+ * Unused for random key generation.
173
+ */
59
174
  get tier(): Tier;
60
175
  }
176
+ /**
177
+ * Deterministically creates a key pair based on combining a salt with a path stretch algorithm.
178
+ * The salt is randomized if not provided.
179
+ */
61
180
  export declare class SaltyCreator implements Creator {
181
+ /**
182
+ * The salter used to create the key pair. Contains the private key.
183
+ */
62
184
  salter: Salter;
185
+ /**
186
+ * Key material prefix used during key stretching.
187
+ * @private
188
+ */
63
189
  private readonly _stem;
64
190
  constructor(salt?: string | undefined, tier?: Tier | undefined, stem?: string | undefined);
65
191
  get salt(): string;
@@ -118,17 +244,23 @@ interface SignArgs {
118
244
  indices?: Array<number> | undefined;
119
245
  ondices?: Array<number> | undefined;
120
246
  }
247
+ /**
248
+ * Manages key pair creation, retrieval, and message signing.
249
+ */
121
250
  export declare class Manager {
122
251
  private _seed?;
123
252
  private _salt?;
124
253
  private _encrypter;
125
254
  private _decrypter;
126
255
  private readonly _ks;
127
- constructor({ ks, seed, aeid, pidx, algo, salter, tier }: ManagerArgs);
256
+ constructor(args: ManagerArgs);
128
257
  get ks(): KeyStore;
129
258
  get encrypter(): Encrypter | undefined;
130
259
  get decrypter(): Decrypter | undefined;
131
260
  get seed(): string | undefined;
261
+ /**
262
+ * qb64 auth encrypt id prefix
263
+ */
132
264
  get aeid(): string | undefined;
133
265
  get pidx(): number | undefined;
134
266
  set pidx(pidx: number | undefined);
@@ -139,12 +271,15 @@ export declare class Manager {
139
271
  get algo(): Algos | undefined;
140
272
  set algo(algo: Algos | undefined);
141
273
  private updateAeid;
142
- incept({ icodes, icount, icode, ncodes, ncount, ncode, dcode, algo, salt, stem, tier, rooted, transferable, temp, }: ManagerInceptArgs): [Array<Verfer>, Array<Diger>];
274
+ incept(args: ManagerInceptArgs): [Array<Verfer>, Array<Diger>];
143
275
  move(old: string, gnu: string): void;
144
- rotate({ pre, ncodes, ncount, ncode, dcode, transferable, temp, erase, }: RotateArgs): [Array<Verfer>, Array<Diger>];
145
- sign({ ser, pubs, verfers, indexed, indices, ondices, }: SignArgs): Siger[] | Cigar[];
276
+ rotate(args: RotateArgs): [Array<Verfer>, Array<Diger>];
277
+ sign(args: SignArgs): Siger[] | Cigar[];
146
278
  }
147
279
  export declare function riKey(pre: string, ridx: number): string;
280
+ /**
281
+ * Sub interface for key store specific functions.
282
+ */
148
283
  export interface KeyStore {
149
284
  getGbls(key: string): string | undefined;
150
285
  pinGbls(key: string, val: string): void;