Skip to content

Commit

Permalink
explaining what's going on as per instructions from reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Cannizzo committed Feb 12, 2024
1 parent a3ee3cc commit 66a042a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ffi/dotnet-idsdk/IoticsIdLib/src/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ public static int Main(string[] args)
TwinIdentity twinIdWithCD = identity.CreateTwinIdentityWithControlDelegation(agentId, "twinKeyName", "#twinName");
Console.WriteLine("Twin identity with CD: " + twinIdWithCD);

// convenience method wrapping UserIdentity#UserDelegatesAuthenticationToAgent
userId.DelegateAuthentication(agentId, "#delegation1");
// string userDelegResult = identity.UserDelegatesAuthenticationToAgent(agentId, userId, "#delegation1");
Console.WriteLine("User delegating to agent 1: OK");

AgentIdentity agentId2 = identity.CreateAgentIdentity(Identity.CreateDefaultSeed(), "agentKeyName2", "#agentName2");
Console.WriteLine("Agent2 identity: " + agentId2);

// string twinDelegResult = twinId.DelegateControl(agentId2, "#delegation1");
// direct call to the Twin delegation functionality, also available as a wrapper call in the TwinIdentity
identity.TwinDelegatesControlToAgent(agentId2, twinId, "#delegation1");
// string twinDelegResult = twinId.DelegateControl(agentId2, "#delegation1");
Console.WriteLine("Twin delegating to agent2: OK");

string token = Identity.CreateAgentAuthToken(agentId, userId.Did, "foo", 10L);
Expand Down

0 comments on commit 66a042a

Please sign in to comment.