コード例 #1
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 (ReferenceData != null)
            {
                user.ReferenceData = JsonConvert.SerializeObject(ReferenceData);
            }

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

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

            return(user);
        }
コード例 #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),
                ReferenceId   = ReferenceId,
            };

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

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

            return(user);
        }