public User ToUser()
        {
            var user = new User
            {
                Name  = Name,
                Email = Email,
                MasterPasswordHint = MasterPasswordHint,
                Kdf           = Kdf.GetValueOrDefault(KdfType.PBKDF2_SHA256),
                KdfIterations = KdfIterations.GetValueOrDefault(5000),
            };

            if (ReferenceData != null)
            {
                user.ReferenceData = JsonConvert.SerializeObject(ReferenceData);
            }

            if (Key != null)
            {
                user.Key = Key;
            }

            if (Keys != null)
            {
                Keys.ToUser(user);
            }

            return(user);
        }
        public User ToUser()
        {
            var user = new User
            {
                Name  = Name,
                Email = Email,
                MasterPasswordHint = MasterPasswordHint,
                Kdf           = Kdf.GetValueOrDefault(KdfType.PBKDF2_SHA256),
                KdfIterations = KdfIterations.GetValueOrDefault(5000),
                ReferenceId   = ReferenceId,
            };

            if (Key != null)
            {
                user.Key = Key;
            }

            if (Keys != null)
            {
                Keys.ToUser(user);
            }

            return(user);
        }