예제 #1
0
        public void UnpackPackedMessageWithMultipleRecipientsSucceeds()
        {
            ICrypto     crypto     = IndyDotNet.Crypto.Factory.GetCrypto(_wallet);
            List <IDid> recipients = new List <IDid>();

            IdentitySeed seed = new IdentitySeed()
            {
                Seed = "00000000000000000000000000000My2"
            };

            recipients.Add(IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed));

            seed = new IdentitySeed()
            {
                Seed = "00000000000000000000000000000My3"
            };
            recipients.Add(IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed));


            PackedMessage   packedMessage   = crypto.PackMessage(recipients, _senderDid, MESSAGE_TO_SEND);
            UnpackedMessage unpackedMessage = crypto.UnpackMessage(packedMessage);

            Assert.IsNotNull(unpackedMessage, $"did not get back an unpacked message");
            Assert.AreEqual(MESSAGE_TO_SEND, unpackedMessage.Message, "unpacked message is not the same as what was sent");
        }
예제 #2
0
        public void PackMessageSucceeds()
        {
            ICrypto       crypto        = IndyDotNet.Crypto.Factory.GetCrypto(_wallet);
            PackedMessage packedMessage = crypto.PackMessage(_senderDid, _senderDid, MESSAGE_TO_SEND);

            Assert.IsNotNull(packedMessage, "crypto.PackMessage failed to return PackMessage instance");
        }
예제 #3
0
        public void UnpackPackedMessageSucceeds()
        {
            ICrypto         crypto          = IndyDotNet.Crypto.Factory.GetCrypto(_wallet);
            PackedMessage   packedMessage   = crypto.PackMessage(_senderDid, _senderDid, MESSAGE_TO_SEND);
            UnpackedMessage unpackedMessage = crypto.UnpackMessage(packedMessage);

            Assert.IsNotNull(unpackedMessage, $"did not get back an unpacked message");
            Assert.AreEqual(MESSAGE_TO_SEND, unpackedMessage.Message, "unpacked message is not the same as what was sent");
        }
예제 #4
0
        public void PackMessageToTwoRecipientsSucceeds()
        {
            IdentitySeed seed = new IdentitySeed()
            {
                Seed = "00000000000000000000000000000My2"
            };

            ICrypto     crypto     = IndyDotNet.Crypto.Factory.GetCrypto(_wallet);
            List <IDid> recipients = new List <IDid>();

            recipients.Add(_senderDid);
            recipients.Add(IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed));

            PackedMessage packedMessage = crypto.PackMessage(recipients, _senderDid, MESSAGE_TO_SEND);

            Assert.IsNotNull(packedMessage, "crypto.PackMessage failed to return PackMessage instance");
        }