예제 #1
0
        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();
        }
        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();
        }