Skip to content

Commit 187071d

Browse files
fix: add submit key on revocation entries topic creating
1 parent 709f502 commit 187071d

40 files changed

+128
-16
lines changed

docs/modules/ROOT/pages/03-implementation/components/anoncreds-api.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Registers a revocation status list in the registry.
137137

138138
==== Fields of `RegisterRevocationStatusListOptions & NetworkName`:
139139
* `networkName` (optional, string): Network name to use.
140+
* `issuerKeyDer` (required, string): The issuer private key in the DER format.
140141
* `revocationStatusList` (required, Anoncreds revocation status list without timestamp): The revocation status list to register.
141142

142143
.Returns

docs/modules/ROOT/pages/03-implementation/components/anoncreds-guide.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ const revStatusList = {
176176
177177
const registerStatusListResult = await registry.registerRevocationStatusList({
178178
networkName: "testnet",
179+
issuerKeyDer: PrivateKey.generate().toStringDer(),
179180
revocationStatusList: revStatusList,
180181
});
181182
@@ -185,6 +186,7 @@ console.log("Revocation Status List registration result:", registerStatusListRes
185186
Parameters:
186187

187188
* `networkName` (optional): Hedera network name.
189+
* `issuerKeyDer` (required, string): The issuer private key in the DER format.
188190
* `revocationStatusList` (required): Revocation status list object without timestamp.
189191

190192
Returns the registration state and metadata.

examples/anoncreds-e2e-demo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ async function main() {
236236
const revListRegistrationResult = await anoncredsRegistry.registerRevocationStatusList({
237237
revocationStatusList: revList,
238238
networkName: network,
239+
issuerKeyDer: issuerPrivateKey.toStringDer(),
239240
});
240241
assert.equal(revListRegistrationResult.revocationStatusListState.state, 'finished');
241242

@@ -257,6 +258,7 @@ async function main() {
257258
const revListUpdateResult = await anoncredsRegistry.registerRevocationStatusList({
258259
revocationStatusList: updatedRevList,
259260
networkName: network,
261+
issuerKeyDer: issuerPrivateKey.toStringDer(),
260262
});
261263
assert.equal(revListUpdateResult.revocationStatusListState.state, 'finished');
262264

examples/anoncreds-register-revocation-status-list.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ async function main() {
130130
issuerId: issuerDid,
131131
revRegDefId,
132132
},
133+
issuerKeyDer,
133134
});
134135
console.log('Revocation status list register result:', result);
135136
} catch (error) {

packages/anoncreds/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @hiero-did-sdk/anoncreds
22

3+
## 0.1.2
4+
5+
### Patch Changes
6+
7+
- 9d8f61d: Add submit key for create the entries topic
8+
- @hiero-did-sdk/core@0.1.2
9+
- @hiero-did-sdk/hcs@0.1.2
10+
- @hiero-did-sdk/zstd@0.1.2
11+
312
## 0.1.1
413

514
### Patch Changes

packages/anoncreds/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hiero-did-sdk/anoncreds",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "This package provides implementation of Hedera AnonCreds Registry, following Hedera AnonCreds Method specification.",
55
"author": {
66
"name": "DSR Corporation",

packages/anoncreds/src/dto/revocation-status-list.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export type AnonCredsRevocationStatusListWithOptionalTimestamp = Optional<AnonCr
2121

2222
export interface RegisterRevocationStatusListOptions {
2323
revocationStatusList: AnonCredsRevocationStatusListWithoutTimestamp;
24+
issuerKeyDer: string;
2425
}
2526

2627
export interface RegisterRevocationStatusListReturnStateAction extends AnonCredsOperationStateAction {

packages/anoncreds/src/hedera-anoncreds-registry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class HederaAnoncredsRegistry {
159159
const { networkName, revocationRegistryDefinition } = options;
160160
try {
161161
const entriesTopicId = await this.hcsService.createTopic({
162+
submitKey: PrivateKey.fromStringDer(options.issuerKeyDer),
162163
waitForChangesVisibility: true,
163164
});
164165
const hcsMetadata = { entriesTopicId };
@@ -261,6 +262,7 @@ export class HederaAnoncredsRegistry {
261262

262263
await this.hcsService.submitMessage({
263264
topicId: entriesTopicId,
265+
submitKey: PrivateKey.fromStringDer(options.issuerKeyDer),
264266
message,
265267
networkName,
266268
waitForChangesVisibility: true,

packages/anoncreds/tests/integration/hedera-anoncreds-registry.e2e.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ describe('Hedera AnonCreds Registry', () => {
272272
issuerId: issuerDid,
273273
revRegDefId,
274274
},
275+
issuerKeyDer
275276
});
276277
expect(registerRevocationStatusListResponse?.revocationStatusListState.state).toEqual('finished');
277278
expect(registerRevocationStatusListResponse?.revocationStatusListState.revocationStatusList).toBeDefined();
@@ -350,6 +351,7 @@ describe('Hedera AnonCreds Registry', () => {
350351
revRegDefId,
351352
revocationList: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
352353
},
354+
issuerKeyDer
353355
});
354356
expect(registerRevocationStatusListResponse1?.revocationStatusListState?.revocationStatusList).toBeDefined();
355357

@@ -360,6 +362,7 @@ describe('Hedera AnonCreds Registry', () => {
360362
revRegDefId,
361363
revocationList: [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
362364
},
365+
issuerKeyDer
363366
});
364367
expect(registerRevocationStatusListResponse2?.revocationStatusListState?.revocationStatusList).toBeDefined();
365368

packages/anoncreds/tests/unit/hedera-anoncreds-registry.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ describe('HederaAnoncredsRegistry', () => {
297297
const result = await registry.registerRevocationStatusList({
298298
revocationStatusList,
299299
networkName: 'testnet',
300+
issuerKeyDer: PrivateKey.generate().toStringDer()
300301
});
301302

302303
expect(result.revocationStatusListState.state).toBe('finished');
@@ -316,6 +317,7 @@ describe('HederaAnoncredsRegistry', () => {
316317
const result = await registry.registerRevocationStatusList({
317318
revocationStatusList,
318319
networkName: 'testnet',
320+
issuerKeyDer: PrivateKey.generate().toStringDer()
319321
});
320322

321323
expect(result.revocationStatusListState.state).toBe('failed');

0 commit comments

Comments
 (0)