@bsv/sdk 1.3.10 → 1.3.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 (41) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/auth/certificates/Certificate.js +1 -1
  3. package/dist/cjs/src/auth/certificates/Certificate.js.map +1 -1
  4. package/dist/cjs/src/auth/certificates/MasterCertificate.js +93 -63
  5. package/dist/cjs/src/auth/certificates/MasterCertificate.js.map +1 -1
  6. package/dist/cjs/src/auth/certificates/VerifiableCertificate.js +2 -2
  7. package/dist/cjs/src/auth/certificates/VerifiableCertificate.js.map +1 -1
  8. package/dist/cjs/src/auth/utils/getVerifiableCertificates.js +1 -1
  9. package/dist/cjs/src/auth/utils/getVerifiableCertificates.js.map +1 -1
  10. package/dist/cjs/src/auth/utils/validateCertificates.js +1 -1
  11. package/dist/cjs/src/auth/utils/validateCertificates.js.map +1 -1
  12. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  13. package/dist/esm/src/auth/certificates/Certificate.js +2 -2
  14. package/dist/esm/src/auth/certificates/Certificate.js.map +1 -1
  15. package/dist/esm/src/auth/certificates/MasterCertificate.js +93 -63
  16. package/dist/esm/src/auth/certificates/MasterCertificate.js.map +1 -1
  17. package/dist/esm/src/auth/certificates/VerifiableCertificate.js +2 -2
  18. package/dist/esm/src/auth/certificates/VerifiableCertificate.js.map +1 -1
  19. package/dist/esm/src/auth/utils/getVerifiableCertificates.js +1 -1
  20. package/dist/esm/src/auth/utils/getVerifiableCertificates.js.map +1 -1
  21. package/dist/esm/src/auth/utils/validateCertificates.js +1 -1
  22. package/dist/esm/src/auth/utils/validateCertificates.js.map +1 -1
  23. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  24. package/dist/types/src/auth/certificates/Certificate.d.ts +3 -3
  25. package/dist/types/src/auth/certificates/Certificate.d.ts.map +1 -1
  26. package/dist/types/src/auth/certificates/MasterCertificate.d.ts +41 -11
  27. package/dist/types/src/auth/certificates/MasterCertificate.d.ts.map +1 -1
  28. package/dist/types/src/auth/certificates/VerifiableCertificate.d.ts +1 -1
  29. package/dist/types/src/auth/certificates/VerifiableCertificate.d.ts.map +1 -1
  30. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  31. package/dist/umd/bundle.js +1 -1
  32. package/docs/auth.md +59 -21
  33. package/package.json +1 -1
  34. package/src/auth/__tests/Peer.test.ts +19 -47
  35. package/src/auth/certificates/Certificate.ts +3 -3
  36. package/src/auth/certificates/MasterCertificate.ts +131 -67
  37. package/src/auth/certificates/VerifiableCertificate.ts +3 -4
  38. package/src/auth/certificates/__tests/MasterCertificate.test.ts +142 -51
  39. package/src/auth/certificates/__tests/VerifiableCertificate.test.ts +25 -30
  40. package/src/auth/utils/getVerifiableCertificates.ts +2 -2
  41. package/src/auth/utils/validateCertificates.ts +2 -2
@@ -19,11 +19,12 @@ describe('MasterCertificate', () => {
19
19
 
20
20
  const subjectWallet = new CompletedProtoWallet(subjectPrivateKey)
21
21
  const certifierWallet = new CompletedProtoWallet(certifierPrivateKey)
22
- let subjectPubKey, certifierPubKey
22
+ let subjectIdentityKey: string
23
+ let certifierIdentityKey: string
23
24
 
24
25
  beforeAll(async () => {
25
- subjectPubKey = (await subjectWallet.getPublicKey({ identityKey: true })).publicKey
26
- certifierPubKey = (await certifierWallet.getPublicKey({ identityKey: true })).publicKey
26
+ subjectIdentityKey = (await subjectWallet.getPublicKey({ identityKey: true })).publicKey
27
+ certifierIdentityKey = (await certifierWallet.getPublicKey({ identityKey: true })).publicKey
27
28
  })
28
29
 
29
30
  describe('constructor', () => {
@@ -42,8 +43,8 @@ describe('MasterCertificate', () => {
42
43
  const certificate = new MasterCertificate(
43
44
  Utils.toBase64(Random(16)), // type
44
45
  Utils.toBase64(Random(16)), // serialNumber
45
- subjectPubKey,
46
- certifierPubKey,
46
+ subjectIdentityKey,
47
+ certifierIdentityKey,
47
48
  mockRevocationOutpoint,
48
49
  fields,
49
50
  masterKeyring
@@ -52,8 +53,8 @@ describe('MasterCertificate', () => {
52
53
  expect(certificate).toBeInstanceOf(MasterCertificate)
53
54
  expect(certificate.fields).toEqual(fields)
54
55
  expect(certificate.masterKeyring).toEqual(masterKeyring)
55
- expect(certificate.subject).toEqual(subjectPubKey)
56
- expect(certificate.certifier).toEqual(certifierPubKey)
56
+ expect(certificate.subject).toEqual(subjectIdentityKey)
57
+ expect(certificate.certifier).toEqual(certifierIdentityKey)
57
58
  })
58
59
 
59
60
  it('should throw if masterKeyring is missing a key for any field', () => {
@@ -64,8 +65,8 @@ describe('MasterCertificate', () => {
64
65
  new MasterCertificate(
65
66
  Utils.toBase64(Random(16)), // type
66
67
  Utils.toBase64(Random(16)), // serialNumber
67
- subjectPubKey,
68
- certifierPubKey,
68
+ subjectIdentityKey,
69
+ certifierIdentityKey,
69
70
  mockRevocationOutpoint,
70
71
  fields,
71
72
  masterKeyring
@@ -74,18 +75,23 @@ describe('MasterCertificate', () => {
74
75
  })
75
76
  })
76
77
 
77
- describe('decryptFields', () => {
78
+ describe('decryptFields (static)', () => {
78
79
  it('should decrypt all fields correctly using subject wallet', async () => {
79
80
  // Issue a certificate for the subject, which includes a valid masterKeyring
80
81
  const certificate = await MasterCertificate.issueCertificateForSubject(
81
82
  certifierWallet,
82
- subjectPubKey,
83
+ subjectIdentityKey,
83
84
  plaintextFields,
84
85
  'TEST_CERT'
85
86
  )
86
87
 
87
- // Now subject should be able to decrypt all fields
88
- const decrypted = await certificate.decryptFields(subjectWallet)
88
+ // Now subject should be able to decrypt all fields via static method
89
+ const decrypted = await MasterCertificate.decryptFields(
90
+ subjectWallet,
91
+ certificate.masterKeyring,
92
+ certificate.fields,
93
+ certificate.certifier // because certifier was the encryption counterparty
94
+ )
89
95
  expect(decrypted).toEqual(plaintextFields)
90
96
  })
91
97
 
@@ -94,8 +100,8 @@ describe('MasterCertificate', () => {
94
100
  expect(() => new MasterCertificate(
95
101
  Utils.toBase64(Random(16)),
96
102
  Utils.toBase64(Random(16)),
97
- subjectPubKey,
98
- certifierPubKey,
103
+ subjectIdentityKey,
104
+ certifierIdentityKey,
99
105
  mockRevocationOutpoint,
100
106
  { name: Utils.toBase64([1, 2, 3]) },
101
107
  {}
@@ -108,8 +114,8 @@ describe('MasterCertificate', () => {
108
114
  const badKeyCertificate = new MasterCertificate(
109
115
  Utils.toBase64(Random(16)),
110
116
  Utils.toBase64(Random(16)),
111
- subjectPubKey,
112
- certifierPubKey,
117
+ subjectIdentityKey,
118
+ certifierIdentityKey,
113
119
  mockRevocationOutpoint,
114
120
  {
115
121
  name: Utils.toBase64(SymmetricKey.fromRandom().encrypt(Utils.toArray('Alice', 'utf8')) as number[])
@@ -117,24 +123,30 @@ describe('MasterCertificate', () => {
117
123
  { name: badKeyMasterKeyring }
118
124
  )
119
125
 
120
- await expect(badKeyCertificate.decryptFields(subjectWallet))
121
- .rejects
122
- .toThrow('Failed to decrypt all master certificate fields.')
126
+ await expect(
127
+ MasterCertificate.decryptFields(
128
+ subjectWallet,
129
+ badKeyCertificate.masterKeyring,
130
+ badKeyCertificate.fields,
131
+ badKeyCertificate.certifier
132
+ )
133
+ ).rejects.toThrow('Failed to decrypt all master certificate fields.')
123
134
  })
124
135
  })
125
136
 
126
- describe('createKeyringForVerifier', () => {
137
+ describe('createKeyringForVerifier (static)', () => {
127
138
  const verifierPrivateKey = PrivateKey.fromRandom()
128
139
  const verifierWallet = new CompletedProtoWallet(verifierPrivateKey)
129
- let verifierPubKey
140
+ let verifierIdentityKey: string
130
141
 
131
142
  let issuedCert: MasterCertificate
132
143
 
133
144
  beforeAll(async () => {
134
- verifierPubKey = (await verifierWallet.getPublicKey({ identityKey: true })).publicKey
145
+ verifierIdentityKey = (await verifierWallet.getPublicKey({ identityKey: true })).publicKey
146
+ // Issue a certificate to reuse in tests
135
147
  issuedCert = await MasterCertificate.issueCertificateForSubject(
136
148
  certifierWallet,
137
- subjectPubKey,
149
+ subjectIdentityKey,
138
150
  plaintextFields,
139
151
  'TEST_CERT'
140
152
  )
@@ -143,10 +155,15 @@ describe('MasterCertificate', () => {
143
155
  it('should create a verifier keyring for specified fields', async () => {
144
156
  // We only want to share "name" with the verifier
145
157
  const fieldsToReveal = ['name']
146
- const keyringForVerifier = await issuedCert.createKeyringForVerifier(
158
+
159
+ const keyringForVerifier = await MasterCertificate.createKeyringForVerifier(
147
160
  subjectWallet,
148
- verifierPubKey,
149
- fieldsToReveal
161
+ issuedCert.certifier, // the original certifier
162
+ verifierIdentityKey, // the new verifier
163
+ issuedCert.fields, // encrypted fields
164
+ fieldsToReveal,
165
+ issuedCert.masterKeyring,
166
+ issuedCert.serialNumber
150
167
  )
151
168
 
152
169
  // The new keyring should only contain "name"
@@ -161,8 +178,8 @@ describe('MasterCertificate', () => {
161
178
  issuedCert.certifier,
162
179
  issuedCert.revocationOutpoint,
163
180
  issuedCert.fields,
164
- issuedCert.signature,
165
- keyringForVerifier
181
+ keyringForVerifier,
182
+ issuedCert.signature
166
183
  )
167
184
 
168
185
  // The verifier should successfully decrypt the "name" field
@@ -170,16 +187,23 @@ describe('MasterCertificate', () => {
170
187
  expect(decrypted).toEqual({ name: plaintextFields.name })
171
188
  })
172
189
 
173
- it('should throw if fields to reveal are not subset of the certificate fields', async () => {
190
+ it('should throw if fields to reveal are not a subset of the certificate fields', async () => {
174
191
  await expect(
175
- issuedCert.createKeyringForVerifier(subjectWallet, verifierPubKey, ['nonexistent_field'])
192
+ MasterCertificate.createKeyringForVerifier(
193
+ subjectWallet,
194
+ issuedCert.certifier,
195
+ verifierIdentityKey,
196
+ issuedCert.fields,
197
+ ['nonexistent_field'],
198
+ issuedCert.masterKeyring
199
+ )
176
200
  ).rejects.toThrow(
177
201
  /Fields to reveal must be a subset of the certificate fields\. Missing the "nonexistent_field" field\./
178
202
  )
179
203
  })
180
204
 
181
205
  it('should throw if the master key fails to decrypt the corresponding field', async () => {
182
- // We'll tamper the certificate's masterKeyring so that a field key is invalid
206
+ // We'll tamper with the certificate's masterKeyring so that a field key is invalid
183
207
  const tamperedCert = new MasterCertificate(
184
208
  issuedCert.type,
185
209
  issuedCert.serialNumber,
@@ -197,46 +221,65 @@ describe('MasterCertificate', () => {
197
221
  )
198
222
 
199
223
  await expect(
200
- tamperedCert.createKeyringForVerifier(subjectWallet, verifierPubKey, ['name'])
201
- ).rejects.toThrow('Decryption failed!')
224
+ MasterCertificate.createKeyringForVerifier(
225
+ subjectWallet,
226
+ tamperedCert.certifier,
227
+ verifierIdentityKey,
228
+ tamperedCert.fields,
229
+ ['name'],
230
+ tamperedCert.masterKeyring,
231
+ tamperedCert.serialNumber
232
+ )
233
+ ).rejects.toThrow('Failed to decrypt certificate field!')
202
234
  })
203
235
 
204
236
  it('should support optional originator parameter', async () => {
205
- // Just to ensure coverage for the originator-based flows
206
237
  const fieldsToReveal = ['name']
207
- const keyringForVerifier = await issuedCert.createKeyringForVerifier(
238
+ const keyringForVerifier = await MasterCertificate.createKeyringForVerifier(
208
239
  subjectWallet,
209
- verifierPubKey,
240
+ issuedCert.certifier,
241
+ verifierIdentityKey,
242
+ issuedCert.fields,
210
243
  fieldsToReveal,
244
+ issuedCert.masterKeyring,
245
+ issuedCert.serialNumber,
211
246
  'my-originator'
212
247
  )
213
248
  expect(keyringForVerifier).toHaveProperty('name')
214
249
  })
215
250
 
216
- it('should support counterparty of "anyone"', async () => {
217
- // Create a keyring for public disclosure of selected fields.
251
+ it('should support counterparty of "anyone" or "self"', async () => {
218
252
  const fieldsToReveal = ['name']
219
- const keyringForVerifier = await issuedCert.createKeyringForVerifier(
253
+
254
+ // "anyone"
255
+ const anyoneKeyring = await MasterCertificate.createKeyringForVerifier(
220
256
  subjectWallet,
257
+ issuedCert.certifier,
221
258
  'anyone',
259
+ issuedCert.fields,
222
260
  fieldsToReveal,
261
+ issuedCert.masterKeyring,
262
+ issuedCert.serialNumber,
223
263
  'my-originator'
224
264
  )
225
- expect(keyringForVerifier).toHaveProperty('name')
226
- })
227
- it('should support counterparty of "self"', async () => {
228
- const fieldsToReveal = ['name']
229
- const keyringForVerifier = await issuedCert.createKeyringForVerifier(
265
+ expect(anyoneKeyring).toHaveProperty('name')
266
+
267
+ // "self"
268
+ const selfKeyring = await MasterCertificate.createKeyringForVerifier(
230
269
  subjectWallet,
270
+ issuedCert.certifier,
231
271
  'self',
272
+ issuedCert.fields,
232
273
  fieldsToReveal,
274
+ issuedCert.masterKeyring,
275
+ issuedCert.serialNumber,
233
276
  'my-originator'
234
277
  )
235
- expect(keyringForVerifier).toHaveProperty('name')
278
+ expect(selfKeyring).toHaveProperty('name')
236
279
  })
237
280
  })
238
281
 
239
- describe('issueCertificateForSubject', () => {
282
+ describe('issueCertificateForSubject (static)', () => {
240
283
  it('should issue a valid MasterCertificate for the given subject', async () => {
241
284
  const newPlaintextFields = {
242
285
  project: 'Top Secret',
@@ -247,16 +290,16 @@ describe('MasterCertificate', () => {
247
290
 
248
291
  const newCert = await MasterCertificate.issueCertificateForSubject(
249
292
  certifierWallet,
250
- subjectPubKey,
293
+ subjectIdentityKey,
251
294
  newPlaintextFields,
252
295
  'TEST_CERT',
253
- revocationFn,
296
+ revocationFn
254
297
  )
255
298
 
256
299
  expect(newCert).toBeInstanceOf(MasterCertificate)
257
300
  // The certificate's fields should be encrypted base64
258
301
  for (const fieldName in newPlaintextFields) {
259
- expect(newCert.fields[fieldName]).toMatch(/^[A-Za-z0-9+/]+=*$/) // base64 check
302
+ expect(newCert.fields[fieldName]).toMatch(/^[A-Za-z0-9+/]+=*$/) // quick base64 check
260
303
  }
261
304
  // The masterKeyring should also contain base64 strings
262
305
  for (const fieldName in newPlaintextFields) {
@@ -266,8 +309,56 @@ describe('MasterCertificate', () => {
266
309
  expect(newCert.revocationOutpoint).toEqual(mockRevocationOutpoint)
267
310
  // Check we have a signature
268
311
  expect(newCert.signature).toBeDefined()
269
- // Check that the revocationFn were called
312
+ // Check that the revocationFn was called
270
313
  expect(revocationFn).toHaveBeenCalledWith(newCert.serialNumber)
271
314
  })
315
+
316
+ it('should allow passing a custom serial number when issuing the certificate', async () => {
317
+ const customSerialNumber = Utils.toBase64(Random(32))
318
+ const newPlaintextFields = { status: 'Approved' }
319
+ const newCert = await MasterCertificate.issueCertificateForSubject(
320
+ certifierWallet,
321
+ subjectIdentityKey,
322
+ newPlaintextFields,
323
+ 'TEST_CERT',
324
+ undefined, // No custom revocation function
325
+ customSerialNumber // Pass our custom serial number
326
+ )
327
+
328
+ expect(newCert).toBeInstanceOf(MasterCertificate)
329
+ expect(newCert.serialNumber).toEqual(customSerialNumber) // Must match exactly
330
+ // Check encryption
331
+ for (const fieldName in newPlaintextFields) {
332
+ expect(newCert.fields[fieldName]).toMatch(/^[A-Za-z0-9+/]+=*$/)
333
+ }
334
+ })
335
+ it('should allow issuing a self-signed certificate and decrypt it with the same wallet', async () => {
336
+ // In a self-signed scenario, the subject and certifier are the same
337
+ const subjectWallet = new CompletedProtoWallet(PrivateKey.fromRandom())
338
+
339
+ // Some sample fields
340
+ const selfSignedFields = {
341
+ owner: 'Bob',
342
+ organization: 'SelfCo'
343
+ }
344
+
345
+ // Issue the certificate for "self"
346
+ const selfSignedCert = await MasterCertificate.issueCertificateForSubject(
347
+ subjectWallet, // act as certifier
348
+ 'self',
349
+ selfSignedFields,
350
+ 'SELF_SIGNED_TEST'
351
+ )
352
+
353
+ // Now we attempt to decrypt the fields with the same wallet
354
+ const decrypted = await MasterCertificate.decryptFields(
355
+ subjectWallet,
356
+ selfSignedCert.masterKeyring,
357
+ selfSignedCert.fields,
358
+ 'self'
359
+ )
360
+
361
+ expect(decrypted).toEqual(selfSignedFields)
362
+ })
272
363
  })
273
364
  })
@@ -2,14 +2,15 @@ import { VerifiableCertificate } from '../../../../dist/cjs/src/auth/certificate
2
2
  import { PrivateKey, SymmetricKey, Utils } from '../../../../dist/cjs/src/primitives/index.js'
3
3
  import { CompletedProtoWallet } from '../../../../dist/cjs/src/auth/certificates/__tests/CompletedProtoWallet.js'
4
4
  import { Certificate } from '../../../../dist/cjs/src/auth/certificates/index.js'
5
+ import { MasterCertificate } from '../../../../dist/cjs/src/auth/certificates/MasterCertificate.js'
5
6
 
6
7
  describe('VerifiableCertificate', () => {
7
8
  const subjectPrivateKey = PrivateKey.fromRandom()
8
- const subjectPubKey = subjectPrivateKey.toPublicKey().toString()
9
+ const subjectIdentityKey = subjectPrivateKey.toPublicKey().toString()
9
10
  const certifierPrivateKey = PrivateKey.fromRandom()
10
- const certifierPubKey = certifierPrivateKey.toPublicKey().toString()
11
+ const certifierIdentityKey = certifierPrivateKey.toPublicKey().toString()
11
12
  const verifierPrivateKey = PrivateKey.fromRandom()
12
- const verifierPubKey = verifierPrivateKey.toPublicKey().toString()
13
+ const verifierIdentityKey = verifierPrivateKey.toPublicKey().toString()
13
14
 
14
15
  const subjectWallet = new CompletedProtoWallet(subjectPrivateKey)
15
16
  const verifierWallet = new CompletedProtoWallet(verifierPrivateKey)
@@ -28,34 +29,28 @@ describe('VerifiableCertificate', () => {
28
29
 
29
30
  beforeEach(async () => {
30
31
  // For each test, we'll build a fresh VerifiableCertificate with valid encryption
31
- const certificateFields = {}
32
- const keyring = {}
33
-
34
- for (const fieldName in plaintextFields) {
35
- // Generate a random field symmetric key
36
- const fieldSymKey = SymmetricKey.fromRandom()
37
- // Encrypt the field's plaintext
38
- const encryptedFieldValue = fieldSymKey.encrypt(Utils.toArray(plaintextFields[fieldName], 'utf8'))
39
- certificateFields[fieldName] = Utils.toBase64(encryptedFieldValue as number[])
40
-
41
- // Now encrypt the fieldSymKey for the verifier
42
- const { ciphertext: encryptedRevelationKey } = await subjectWallet.encrypt({
43
- plaintext: fieldSymKey.toArray(),
44
- ...Certificate.getCertificateFieldEncryptionDetails(sampleSerialNumber, fieldName),
45
- counterparty: verifierPubKey
46
- })
47
- keyring[fieldName] = Utils.toBase64(encryptedRevelationKey)
48
- }
49
-
32
+ const { certificateFields, masterKeyring } = await MasterCertificate.createCertificateFields(
33
+ subjectWallet,
34
+ certifierIdentityKey,
35
+ plaintextFields
36
+ )
37
+ const keyringForVerifier = await MasterCertificate.createKeyringForVerifier(
38
+ subjectWallet,
39
+ certifierIdentityKey,
40
+ verifierIdentityKey,
41
+ certificateFields,
42
+ Object.keys(certificateFields),
43
+ masterKeyring,
44
+ sampleSerialNumber
45
+ )
50
46
  verifiableCert = new VerifiableCertificate(
51
47
  sampleType,
52
48
  sampleSerialNumber,
53
- subjectPubKey,
54
- certifierPubKey,
49
+ subjectIdentityKey,
50
+ certifierIdentityKey,
55
51
  sampleRevocationOutpoint,
56
52
  certificateFields,
57
- undefined, // signature
58
- keyring
53
+ keyringForVerifier
59
54
  )
60
55
  })
61
56
 
@@ -64,8 +59,8 @@ describe('VerifiableCertificate', () => {
64
59
  expect(verifiableCert).toBeInstanceOf(VerifiableCertificate)
65
60
  expect(verifiableCert.type).toEqual(sampleType)
66
61
  expect(verifiableCert.serialNumber).toEqual(sampleSerialNumber)
67
- expect(verifiableCert.subject).toEqual(subjectPubKey)
68
- expect(verifiableCert.certifier).toEqual(certifierPubKey)
62
+ expect(verifiableCert.subject).toEqual(subjectIdentityKey)
63
+ expect(verifiableCert.certifier).toEqual(certifierIdentityKey)
69
64
  expect(verifiableCert.revocationOutpoint).toEqual(sampleRevocationOutpoint)
70
65
  expect(verifiableCert.fields).toBeDefined()
71
66
  expect(verifiableCert.keyring).toBeDefined()
@@ -97,8 +92,8 @@ describe('VerifiableCertificate', () => {
97
92
  verifiableCert.certifier,
98
93
  verifiableCert.revocationOutpoint,
99
94
  fields,
100
- verifiableCert.signature,
101
- {} // empty
95
+ {}, // empty
96
+ verifiableCert.signature
102
97
  )
103
98
 
104
99
  await expect(emptyKeyringCert.decryptFields(verifierWallet)).rejects.toThrow(
@@ -33,8 +33,8 @@ export const getVerifiableCertificates = async (wallet: WalletInterface, request
33
33
  certificate.certifier,
34
34
  certificate.revocationOutpoint,
35
35
  certificate.fields,
36
- certificate.signature,
37
- keyringForVerifier
36
+ keyringForVerifier,
37
+ certificate.signature
38
38
  )
39
39
  }))
40
40
  }
@@ -24,8 +24,8 @@ export const validateCertificates = async (verifierWallet: WalletInterface, mess
24
24
  incomingCert.certifier,
25
25
  incomingCert.revocationOutpoint,
26
26
  incomingCert.fields,
27
- incomingCert.signature,
28
- incomingCert.keyring
27
+ incomingCert.keyring,
28
+ incomingCert.signature
29
29
  )
30
30
  const isValidCert = await certToVerify.verify()
31
31
  if (!isValidCert) {