コード例 #1
0
ファイル: SessionState.cs プロジェクト: Muraad/libaxolotl-net
 public void SetSenderChainKey(ChainKey senderChainKey)
 {
     var chainKey = new Chain.ChainKey {
         key = senderChainKey.Key,
         index = senderChainKey.Index
     };
     Structure.SenderChain.chainKey = chainKey;
 }
コード例 #2
0
ファイル: SessionState.cs プロジェクト: Muraad/libaxolotl-net
 public void SetReceiverChainKey(ECPublicKey senderEphemeral, ChainKey chainKey)
 {
     var chainAndIndex = GetReceiverChain(senderEphemeral);
     var chain = chainAndIndex.Item1;
     var chainKeyStructure = new Chain.ChainKey {
         key = chainKey.Key,
         index = (UInt32)chainKey.Index
     };
     chain.chainKey = chainKeyStructure;
 }
コード例 #3
0
ファイル: SessionState.cs プロジェクト: Muraad/libaxolotl-net
        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;
        }
コード例 #4
0
ファイル: SessionState.cs プロジェクト: Muraad/libaxolotl-net
        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);
            }
        }