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);
        }
Beispiel #2
0
        public User ToUser()
        {
            var user = new User
            {
                Name  = Name,
                Email = Email,
                MasterPasswordHint = MasterPasswordHint,
                Kdf           = Kdf.GetValueOrDefault(KdfType.PBKDF2_SHA256),
                KdfIterations = KdfIterations.GetValueOrDefault(5000)
            };

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

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

            return(user);
        }