コード例 #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"
                      } }
                }
            });
        }
コード例 #2
0
        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")
            });
        }
コード例 #3
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);
        }
コード例 #4
0
        public async Task CanDiscoverProtocols()
        {
            var(agent1Con, agent2Con) = await AgentScenarios.EstablishConnectionAsync(_agent1, _agent2);

            await AgentScenarios.DiscoveryProtocolWithReturnRoutingAsync(_agent1, _agent2, agent1Con, agent2Con);
        }
コード例 #5
0
 public async Task CanConnect()
 {
     await AgentScenarios.EstablishConnectionAsync(_agent1, _agent2);
 }
コード例 #6
0
 public async Task CanConnect(bool useDidKeyFormat)
 {
     await AgentScenarios.EstablishConnectionAsync(_agent1, _agent2, useDidKeyFormat);
 }