@bsv/sdk 1.3.31 → 1.3.32
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.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/auth/certificates/Certificate.js +11 -4
- package/dist/cjs/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/auth/certificates/Certificate.js +11 -4
- package/dist/esm/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/auth/certificates/Certificate.d.ts +10 -3
- package/dist/types/src/auth/certificates/Certificate.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/auth.md +11 -4
- package/package.json +1 -1
- package/src/auth/certificates/Certificate.ts +11 -4
package/docs/auth.md
CHANGED
|
@@ -334,6 +334,12 @@ Argument Details
|
|
|
334
334
|
|
|
335
335
|
Helper function which retrieves the protocol ID and key ID for certificate field encryption.
|
|
336
336
|
|
|
337
|
+
For master certificate creation, no serial number is provided because entropy is required
|
|
338
|
+
from both the client and the certifier. In this case, the `keyID` is simply the `fieldName`.
|
|
339
|
+
|
|
340
|
+
For VerifiableCertificates verifier keyring creation, both the serial number and field name are available,
|
|
341
|
+
so the `keyID` is formed by concatenating the `serialNumber` and `fieldName`.
|
|
342
|
+
|
|
337
343
|
```ts
|
|
338
344
|
static getCertificateFieldEncryptionDetails(fieldName: string, serialNumber?: string): {
|
|
339
345
|
protocolID: WalletProtocol;
|
|
@@ -344,16 +350,17 @@ See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
|
344
350
|
|
|
345
351
|
Returns
|
|
346
352
|
|
|
347
|
-
An object containing
|
|
353
|
+
An object containing:
|
|
348
354
|
- `protocolID` (WalletProtocol): The protocol ID for certificate field encryption.
|
|
349
|
-
- `keyID` (string): A unique key identifier
|
|
355
|
+
- `keyID` (string): A unique key identifier. It is the `fieldName` if `serialNumber` is undefined,
|
|
356
|
+
otherwise it is a combination of `serialNumber` and `fieldName`.
|
|
350
357
|
|
|
351
358
|
Argument Details
|
|
352
359
|
|
|
353
|
-
+ **serialNumber**
|
|
354
|
-
+ The serial number of the certificate.
|
|
355
360
|
+ **fieldName**
|
|
356
361
|
+ The name of the field within the certificate to be encrypted.
|
|
362
|
+
+ **serialNumber**
|
|
363
|
+
+ (Optional) The serial number of the certificate.
|
|
357
364
|
|
|
358
365
|
#### Method sign
|
|
359
366
|
|
package/package.json
CHANGED
|
@@ -258,11 +258,18 @@ export default class Certificate {
|
|
|
258
258
|
/**
|
|
259
259
|
* Helper function which retrieves the protocol ID and key ID for certificate field encryption.
|
|
260
260
|
*
|
|
261
|
-
*
|
|
261
|
+
* For master certificate creation, no serial number is provided because entropy is required
|
|
262
|
+
* from both the client and the certifier. In this case, the `keyID` is simply the `fieldName`.
|
|
263
|
+
*
|
|
264
|
+
* For VerifiableCertificates verifier keyring creation, both the serial number and field name are available,
|
|
265
|
+
* so the `keyID` is formed by concatenating the `serialNumber` and `fieldName`.
|
|
266
|
+
*
|
|
262
267
|
* @param fieldName - The name of the field within the certificate to be encrypted.
|
|
263
|
-
* @
|
|
268
|
+
* @param serialNumber - (Optional) The serial number of the certificate.
|
|
269
|
+
* @returns An object containing:
|
|
264
270
|
* - `protocolID` (WalletProtocol): The protocol ID for certificate field encryption.
|
|
265
|
-
* - `keyID` (string): A unique key identifier
|
|
271
|
+
* - `keyID` (string): A unique key identifier. It is the `fieldName` if `serialNumber` is undefined,
|
|
272
|
+
* otherwise it is a combination of `serialNumber` and `fieldName`.
|
|
266
273
|
*/
|
|
267
274
|
static getCertificateFieldEncryptionDetails(
|
|
268
275
|
fieldName: string,
|
|
@@ -270,7 +277,7 @@ export default class Certificate {
|
|
|
270
277
|
): { protocolID: WalletProtocol, keyID: string } {
|
|
271
278
|
return {
|
|
272
279
|
protocolID: [2, 'certificate field encryption'],
|
|
273
|
-
keyID: `${serialNumber
|
|
280
|
+
keyID: serialNumber ? `${serialNumber} ${fieldName}` : fieldName
|
|
274
281
|
}
|
|
275
282
|
}
|
|
276
283
|
}
|