コード例 #1
0
ファイル: SenderKeyState.cs プロジェクト: jmue/libaxolotl-uwp
        public void addSenderMessageKey(SenderMessageKey senderMessageKey)
        {
            SenderKeyStateStructure.Types.SenderMessageKey senderMessageKeyStructure =
                SenderKeyStateStructure.Types.SenderMessageKey.CreateBuilder()
                .SetIteration(senderMessageKey.getIteration())
                .SetSeed(ByteString.CopyFrom(senderMessageKey.getSeed()))
                .Build();

            this.senderKeyStateStructure = this.senderKeyStateStructure.ToBuilder()
                                           .AddSenderMessageKeys(senderMessageKeyStructure)
                                           .Build();
        }
コード例 #2
0
        public void addSenderMessageKey(SenderMessageKey senderMessageKey)
        {
            SenderKeyStateStructure.Types.SenderMessageKey senderMessageKeyStructure = new SenderKeyStateStructure.Types.SenderMessageKey
            {
                Iteration = senderMessageKey.getIteration(),
                Seed      = ByteString.CopyFrom(senderMessageKey.getSeed())
            };
            this.senderKeyStateStructure.SenderMessageKeys.Add(senderMessageKeyStructure);

            if (senderKeyStateStructure.SenderMessageKeys.Count > MAX_MESSAGE_KEYS)
            {
                senderKeyStateStructure.SenderMessageKeys.RemoveAt(0);
            }
        }
コード例 #3
0
        public void addSenderMessageKey(SenderMessageKey senderMessageKey)
        {
            SenderKeyStateStructure.Types.SenderMessageKey senderMessageKeyStructure =
                SenderKeyStateStructure.Types.SenderMessageKey.CreateBuilder()
                .SetIteration(senderMessageKey.getIteration())
                .SetSeed(ByteString.CopyFrom(senderMessageKey.getSeed()))
                .Build();

            SenderKeyStateStructure.Builder builder = this.senderKeyStateStructure.ToBuilder();
            builder.AddSenderMessageKeys(senderMessageKeyStructure);

            if (builder.SenderMessageKeysList.Count > MAX_MESSAGE_KEYS)
            {
                builder.SenderMessageKeysList.RemoveAt(0);
            }
            this.senderKeyStateStructure = builder.Build();
        }