Example #1
0
        public void SetSenderChain(ECKeyPair senderRatchetKeyPair, ChainKey chainKey)
        {
            var chainKeyStructure = new Chain.ChainKey {
                key = chainKey.Key,
                index = (UInt32)chainKey.Index
            };

            var senderChain = new Chain {
                SenderRatchetKey = senderRatchetKeyPair.PublicKey.Serialize(),
                SenderRatchetKeyPrivate = senderRatchetKeyPair.PrivateKey.Serialize(),
                chainKey = chainKeyStructure
            };

            Structure.SenderChain = senderChain;
        }
Example #2
0
        public void AddReceiverChain(ECPublicKey senderRatchetKey, ChainKey chainKey)
        {
            var chainKeyStructure = new Chain.ChainKey {
                key = chainKey.Key,
                index = (UInt32)chainKey.Index
            };

            var chain = new Chain {
                chainKey = chainKeyStructure,
                SenderRatchetKey = senderRatchetKey.Serialize()
            };

            Structure.ReceiverChains.Add(chain);

            if(Structure.ReceiverChains.Count > 5)
            {
                Structure.ReceiverChains.RemoveAt(0);
            }
        }