Exemplo n.º 1
0
        public SenderKeyRecord(byte[] serialized)
        {
            SenderKeyRecordStructure senderKeyRecordStructure = SenderKeyRecordStructure.ParseFrom(serialized);

            foreach (StorageProtos.SenderKeyStateStructure structure in senderKeyRecordStructure.SenderKeyStatesList)
            {
                this.senderKeyStates.Add(new SenderKeyState(structure));
            }
        }
        public SenderKeyRecord(byte[] serialized)
        {
            SenderKeyRecordStructure senderKeyRecordStructure = SenderKeyRecordStructure.Parser.ParseFrom(serialized);

            foreach (SenderKeyStateStructure structure in senderKeyRecordStructure.SenderKeyStates)
            {
                _senderKeyStates.AddFirst(new SenderKeyState(structure));
            }
        }
Exemplo n.º 3
0
        public byte[] serialize()
        {
            SenderKeyRecordStructure.Builder recordStructure = SenderKeyRecordStructure.CreateBuilder();

            foreach (SenderKeyState senderKeyState in senderKeyStates)
            {
                recordStructure.AddSenderKeyStates(senderKeyState.getStructure());
            }

            return(recordStructure.Build().ToByteArray());
        }
        public byte[] Serialize()
        {
            SenderKeyRecordStructure recordStructure = new SenderKeyRecordStructure
            {
            };

            foreach (SenderKeyState senderKeyState in _senderKeyStates)
            {
                recordStructure.SenderKeyStates.Add(senderKeyState.GetStructure());
            }

            return(recordStructure.ToByteArray());
        }