示例#1
0
文件: OpUser.cs 项目: nandub/DeOps
        public UpdateInfo ReadUpdateInfo()
        {
            if (!File.Exists(BootstrapPath))
            {
                return(null);
            }

            try
            {
                using (IVCryptoStream crypto = IVCryptoStream.Load(BootstrapPath, BootstrapKey))
                {
                    PacketStream stream = new PacketStream(crypto, new G2Protocol(), FileAccess.Read);

                    G2Header root = null;

                    while (stream.ReadPacket(ref root))
                    {
                        if (root.Name == IdentityPacket.Update)
                        {
                            return(UpdateInfo.Decode(root));
                        }
                    }
                }
            }
            catch { }

            return(null);
        }