Esempio n. 1
0
        public async Task CanPerformProofProtocol()
        {
            (var issuerConnection, var holderConnection) = await AgentScenarios.EstablishConnectionAsync(_issuerAgent, _holderAgent);

            await AgentScenarios.IssueCredentialAsync(_issuerAgent, _holderAgent, issuerConnection, holderConnection, new List <CredentialPreviewAttribute>
            {
                new CredentialPreviewAttribute("first_name", "Test"),
                new CredentialPreviewAttribute("last_name", "Holder")
            });

            (var holderRequestorConnection, var requestorConnection) = await AgentScenarios.EstablishConnectionAsync(_holderAgent, _requestorAgent);

            await AgentScenarios.ProofProtocolAsync(_requestorAgent, _holderAgent, requestorConnection,
                                                    holderRequestorConnection, new ProofRequest()
            {
                Name                = "ProofReq",
                Version             = "1.0",
                Nonce               = $"0{Guid.NewGuid().ToString("N")}",
                RequestedAttributes = new Dictionary <string, ProofAttributeInfo>
                {
                    { "first-name-requirement", new ProofAttributeInfo {
                          Name = "first_name"
                      } }
                }
            });
        }
 public async Task CanIssueCredentialConnectionless(bool useDidKeyFormat)
 {
     await AgentScenarios.IssueCredentialConnectionlessAsync(_issuerAgent, _holderAgent, new List <CredentialPreviewAttribute>
     {
         new CredentialPreviewAttribute("first_name", "Test"),
         new CredentialPreviewAttribute("last_name", "Holder")
     }, useDidKeyFormat);
 }
        public async Task CanIssueCredential()
        {
            (var issuerConnection, var holderConnection) = await AgentScenarios.EstablishConnectionAsync(_issuerAgent, _holderAgent);

            await AgentScenarios.IssueCredentialAsync(_issuerAgent, _holderAgent, issuerConnection, holderConnection, new List <CredentialPreviewAttribute>
            {
                new CredentialPreviewAttribute("first_name", "Test"),
                new CredentialPreviewAttribute("last_name", "Holder")
            });
        }
Esempio n. 4
0
        public async Task CanPerformProofProtocolConnectionless(bool useDidKeyFormat)
        {
            (var issuerConnection, var holderConnection) = await AgentScenarios.EstablishConnectionAsync(_issuerAgent, _holderAgent);

            await AgentScenarios.IssueCredentialAsync(_issuerAgent, _holderAgent, issuerConnection, holderConnection, new List <CredentialPreviewAttribute>
            {
                new CredentialPreviewAttribute("first_name", "Test"),
                new CredentialPreviewAttribute("last_name", "Holder")
            });

            await AgentScenarios.ProofProtocolConnectionlessAsync(_requestorAgent, _holderAgent, new ProofRequest()
            {
                Name                = "ProofReq",
                Version             = "1.0",
                Nonce               = await AnonCreds.GenerateNonceAsync(),
                RequestedAttributes = new Dictionary <string, ProofAttributeInfo>
                {
                    { "first-name-requirement", new ProofAttributeInfo {
                          Name = "first_name"
                      } }
                }
            }, useDidKeyFormat);
        }
        public async Task CanDiscoverProtocols()
        {
            var(agent1Con, agent2Con) = await AgentScenarios.EstablishConnectionAsync(_agent1, _agent2);

            await AgentScenarios.DiscoveryProtocolWithReturnRoutingAsync(_agent1, _agent2, agent1Con, agent2Con);
        }
 public void CanUseHttpsMessageType()
 {
     AgentScenarios.CreateBasicMessageWithHttpsType(_agent2);
 }
 public void CanUseLegacyMessageType()
 {
     AgentScenarios.CreateBasicMessageWithLegacyType(_agent1);
 }
 public async Task CanConnectWithReturnRouting()
 {
     await AgentScenarios.EstablishConnectionWithReturnRoutingAsync(_agent1, _agent2);
 }
 public async Task CanConnect()
 {
     await AgentScenarios.EstablishConnectionAsync(_agent1, _agent2);
 }
 public async Task CanConnectWithReturnRouting(bool useDidKeyFormat)
 {
     await AgentScenarios.EstablishConnectionWithReturnRoutingAsync(_agent1, _agent2, useDidKeyFormat);
 }
 public async Task CanConnect(bool useDidKeyFormat)
 {
     await AgentScenarios.EstablishConnectionAsync(_agent1, _agent2, useDidKeyFormat);
 }