Skip to content

Commit fa4a34a

Browse files
authored
Merge pull request hyperledger-indy#796 from divacvl/encoded_values_in_claim_attributes_JSON_file
Fixed wrong encoded value of claim attribute
2 parents 24a8b49 + 9cb0784 commit fa4a34a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

doc/how-tos/issue-credential/java/IssueCredential.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ static void demo() throws Exception {
102102
claimDef, masterSecretName).get();
103103
System.out.println("Claim Request:\n" + claimRequestJSON);
104104

105-
// 1
105+
// 16
106106
System.out.println("\n16. Issuer (Trust Anchor) creates Claim for Claim Request\n");
107-
String claimAttributesJson = "{\n" +
108-
" \"sex\":[\"male\",\"5944657099558967239210949258394887428692050081607692519917050011144233115103\"],\n" +
109-
" \"name\":[\"Alex\",\"1139481716457488690172217916278103335\"],\n" +
110-
" \"height\":[\"175\",\"175\"],\n" +
111-
" \"age\":[\"28\",\"28\"]\n" +
112-
" }";
107+
// Encoded value of non-integer attribute is SHA256 converted to decimal
108+
String credAttribsJson = "{\n" +
109+
" \"sex\":[\"male\",\"5944657099558967239210949258394887428692050081607692519917050011144233115103\"],\n" +
110+
" \"name\":[\"Alex\",\"99262857098057710338306967609588410025648622308394250666849665532448612202874\"],\n" +
111+
" \"height\":[\"175\",\"175\"],\n" +
112+
" \"age\":[\"28\",\"28\"]\n" +
113+
" }";
113114
AnoncredsResults.IssuerCreateClaimResult createClaimResult = issuerCreateClaim(walletHandle, claimRequestJSON,
114115
claimAttributesJson, - 1).get();
115116
String claimJSON = createClaimResult.getClaimJson();

doc/how-tos/issue-credential/java/step4.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
System.out.println("Cred Request:\n" + credRequestJSON);
99

1010
System.out.println("\n16. Issuer (Trust Anchor) creates Credential for Credential Request\n");
11+
// Encoded value of non-integer attribute is SHA256 converted to decimal
1112
String credAttribsJson = "{\n" +
1213
" \"sex\":[\"male\",\"5944657099558967239210949258394887428692050081607692519917050011144233115103\"],\n" +
13-
" \"name\":[\"Alex\",\"1139481716457488690172217916278103335\"],\n" +
14+
" \"name\":[\"Alex\",\"99262857098057710338306967609588410025648622308394250666849665532448612202874\"],\n" +
1415
" \"height\":[\"175\",\"175\"],\n" +
1516
" \"age\":[\"28\",\"28\"]\n" +
1617
" }";

0 commit comments

Comments
 (0)