From 66a042a28c1fd96fc62ca97937ff782332b96443 Mon Sep 17 00:00:00 2001 From: Fabrizio Cannizzo Date: Mon, 12 Feb 2024 19:49:38 +0000 Subject: [PATCH] explaining what's going on as per instructions from reviewer --- ffi/dotnet-idsdk/IoticsIdLib/src/Main.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ffi/dotnet-idsdk/IoticsIdLib/src/Main.cs b/ffi/dotnet-idsdk/IoticsIdLib/src/Main.cs index 6619183..8493369 100644 --- a/ffi/dotnet-idsdk/IoticsIdLib/src/Main.cs +++ b/ffi/dotnet-idsdk/IoticsIdLib/src/Main.cs @@ -29,6 +29,7 @@ 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"); @@ -36,8 +37,9 @@ public static int Main(string[] args) 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);