Skip to content

Commit

Permalink
Use a selective proof
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Sep 28, 2023
1 parent 857a980 commit 61a4b28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ As a student, I want to authenticate using my university account (OpenID Connect
As an HR employee, I want to verify the job candidate has a degree from this university. The HR employee needs verification but does not require to see the data.

- The sample creates University diplomas as BBS+ verifiable credentials.
- The credentials will be issued using OIDC to a candidate mobile wallet.
- The credentials will be issued using OIDC (If possible) to a candidate mobile wallet.
- The Issuer uses a trust registry so that the verifier can validate that the VC is authentic.
- The verifier will use BBS+ selective disclosure to validate a diploma.
- The university application requires an admin zone and a student zone.
Expand Down
23 changes: 11 additions & 12 deletions src/TrinsicV2WebWallet/GenerateProofService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,21 @@ public async Task<CreateProofResponse> CreateProof(string userAuthToken, string
// Auth token from user
_trinsicService.Options.AuthToken = userAuthToken;

var createProofResponse = await _trinsicService.Credential.CreateProofAsync(new CreateProofRequest
//var createProofResponse = await _trinsicService.Credential.CreateProofAsync(new CreateProofRequest
//{
// ItemId = credentialItemId,
//});

var selectiveProof = await _trinsicService.Credential.CreateProofAsync(new()
{
ItemId = credentialItemId,
RevealTemplate = new()
{
TemplateAttributes = { "firstName", "lastName", "dateOfBirth", "diplomaTitle" }
}
});

//var selectiveProof = await _trinsicService.Credential.CreateProofAsync(new()
//{
// DocumentJson = credentialJson.DocumentJson,
// RevealTemplate = new()
// {
// // The other field, not disclosed, is "age"
// TemplateAttributes = { "firstName", "lastName" }
// }
//});

return createProofResponse;
return selectiveProof;
}

public AuthenticateInitResponse AuthenticateInit(string userId, string universityEcosystemId)
Expand Down

0 comments on commit 61a4b28

Please sign in to comment.