Beispiel #1
0
        public void testHandshakeReuseMsg()
        {
            OutOfBandV1_0 outofband = OutOfBand.v1_0("testForRelationship", "testInviteUrl");
            JsonObject    msg       = outofband.handshakeReuseMsg(TestHelpers.getContext());

            testHandshakeReuseMsg(msg);
        }
Beispiel #2
0
 public int __decode(byte[] binData, ref int pos) 
 { 
     this.routing = new Routing(); 
     this.routing.__decode(binData, ref pos); 
     this.oob = new OutOfBand(); 
     this.oob.__decode(binData, ref pos); 
     return pos; 
 } 
Beispiel #3
0
 public System.Collections.Generic.List<byte> __encode() 
 { 
     var data = new System.Collections.Generic.List<byte>(); 
     if (this.routing == null) this.routing = new Routing(); 
     data.AddRange(this.routing.__encode()); 
     if (this.oob == null) this.oob = new OutOfBand(); 
     data.AddRange(this.oob.__encode()); 
     return data; 
 } 
Beispiel #4
0
        void DoCreateConnection()
        {
            // handler for messages in Connecting protocol
            ConnectionsV1_0 connecting = Connecting.v1_0("", "");

            handlers.addHandler(
                connecting,
                (msgName, message) =>
            {
                if ("request-received".Equals(msgName))
                {
                    requestReceived = true;
                }
                else if ("response-sent".Equals(msgName))
                {
                    startResponse = true;
                }
                else
                {
                    nonHandled(msgName, message);
                }
            }
                );

            // handler for relationship-reused message which is sent by the ConnectMe app if it is already connected with this example app agent
            OutOfBandV1_0 oob = OutOfBand.v1_0("", "");

            handlers.addHandler(
                oob,
                (msgName, message) =>
            {
                if ("relationship-reused".Equals(msgName))
                {
                    Console.SetOut(App.console);
                    Console.WriteLine();
                    consolePrintMessage(msgName, message);
                    Console.WriteLine("The mobile wallet app signalled that it already has the connection with this example app agent");
                    Console.WriteLine("This example app does not support relationship-reuse since it does not store the data about previous relationships");
                    Console.WriteLine("Please delete existing connection in your mobile wallet and re-run this application");
                    Console.WriteLine("To learn how relationship-reuse can be used check out \"ssi-auth\" or \"out-of-band\" sample apps");
                    Environment.Exit(-1);
                }
                else
                {
                    nonHandled(msgName, message);
                }
            }
                );

            WaitFor(ref requestReceived, "Waiting to receive Request");

            WaitFor(ref startResponse, "Responding to connection request");
        }
Beispiel #5
0
        public void testGetMessageType()
        {
            OutOfBandV1_0 outofbandProvisioning =
                OutOfBand.v1_0("testForRelationship", "testInviteUrl");
            string msgName = "msg name";

            Assert.AreEqual(
                Util.getMessageType(
                    Util.COMMUNITY_MSG_QUALIFIER,
                    "out-of-band",
                    "1.0",
                    msgName
                    ),
                Util.getMessageType(outofbandProvisioning, msgName)
                );
        }
Beispiel #6
0
 public Tracing(Routing routing, OutOfBand oob) 
 { 
     this.routing = routing; 
     this.oob = oob; 
 } 
Beispiel #7
0
 public OutOfBand oob; //来自客户端的带外信息  
 public Tracing()  
 { 
     routing = new Routing();  
     oob = new OutOfBand();  
 } 
Beispiel #8
0
        public void testGetThreadId()
        {
            OutOfBandV1_0 testProtocol = OutOfBand.v1_0("testForRelationship", "testInviteUrl");

            Assert.IsNotNull(testProtocol.getThreadId());
        }