From ab22b79e7f5987cd826fff0a6a5199a27ea85d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Garc=C3=ADa?= Date: Tue, 8 Nov 2022 11:27:58 +0100 Subject: [PATCH] added neccesary information to configuration.json to build multivalued credential and cleaned new example --- configuration.json | 10 ++++++++++ .../9.addEntityMultivaluedCredential.js | 12 ++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/configuration.json b/configuration.json index 7e3680b..fa20531 100644 --- a/configuration.json +++ b/configuration.json @@ -49,6 +49,16 @@ "subjectAlastriaID": "did:ala:quor:redt:0x12eeaCCA9eEbB78eB97d7cac6b", "credentialKey": "StudentID", "credentialValue": "11235813", + "credentialKeyFather":"Driving licence", + "credentialValueFather": {}, + "credentialSubKey1": "Driver`s Name", + "credentialSubKey2": "Driver`s Surname", + "credentialSubKey3": "Type of licence", + "credentialSubKey4": "Years with the licence", + "credentialSubValue1": "PersonName", + "credentialSubValue2": "PersonSurname", + "credentialSubValue3": "B", + "credentialSubValue4": "20 years", "uri": "www.google.com", "procUrl": "https://www.empresa.com/alastria/businessprocess/4583", "procHash": "H398sjHd...kldjUYn475n", diff --git a/exampleCredentials/9.addEntityMultivaluedCredential.js b/exampleCredentials/9.addEntityMultivaluedCredential.js index d7d35a9..2d8e125 100644 --- a/exampleCredentials/9.addEntityMultivaluedCredential.js +++ b/exampleCredentials/9.addEntityMultivaluedCredential.js @@ -11,8 +11,7 @@ const { const configData = JSON.parse(rawdata) const keyDataEntity1 = fs.readFileSync( - //'../keystores/entity1-a9728125c573924b2b1ad6a8a8cd9bf6858ced49.json' - '../keystores/eu-issuer.json' + '../keystores/entity1-a9728125c573924b2b1ad6a8a8cd9bf6858ced49.json' ) const keystoreDataEntity1 = JSON.parse(keyDataEntity1) @@ -48,10 +47,8 @@ const { const jti = configData.jti const kidCredential = configData.kidCredential - //const subjectAlastriaID = configData.subjectAlastriaID - const subjectAlastriaID = configData.didEuSubject - //const didEntity1 = configData.didEntity1 - const didEntity1 = configData.didEuIssuer + const subjectAlastriaID = configData.subjectAlastriaID + const didEntity1 = configData.didEntity1 const context = configData.context const tokenExpTime = configData.tokenExpTime const tokenActivationDate = configData.tokenActivationDate @@ -155,8 +152,7 @@ const { const issuerCredentialTransaction = transactionFactory.credentialRegistry.getIssuerCredentialStatus( web3, - //configData.didEntity1, - configData.didEuIssuer, + configData.didEntity1, credentialHash ) web3.eth