Esempio n. 1
0
        public HubUser SetUser(string hubName, string name,
                               string groupName,
                               string realName, string note,
                               DateTime createTime,
                               DateTime updatedTime,
                               DateTime expireTime,
                               uint numLogin,
                               AuthType authType,
                               byte[] hashedPw,
                               byte[] securePw)
        {
            var requestData = new SoftEtherParameterCollection
            {
                { "HubName", hubName },
                { "Name", name },
                { "GroupName", groupName },
                { "Realname", SoftEtherValueType.UnicodeString, realName },
                { "Note", SoftEtherValueType.UnicodeString, note },
                { "CreatedTime", createTime },
                { "UpdatedTime", updatedTime },
                { "ExpireTime", expireTime },
                { "NumLogin", numLogin },
                { "AuthType", (int)authType },
                { "HashedKey", hashedPw },
                { "NtLmSecureHash", securePw }
            };

            var rawData = _softEther.CallMethod("SetUser", requestData);

            return(HubUser.Deserialize(rawData));
        }
Esempio n. 2
0
        public HubUser DeleteUser(string hubName, string name)
        {
            var requestData = new SoftEtherParameterCollection
            {
                { "HubName", hubName },
                { "Name", name }
            };

            var rawData = _softEther.CallMethod("DeleteUser", requestData);

            return(HubUser.Deserialize(rawData));
        }
Esempio n. 3
0
        public HubUser CreateUser(string hubName, string name, string password, string groupName = null,
                                  string realName = null, string note = null, DateTime?expireTime = null)
        {
            var hashPair = _softEther.CreateUserHashAndNtLm(name, password);

            var requestData = new SoftEtherParameterCollection
            {
                { "HubName", hubName },
                { "Name", name },
                { "GroupName", groupName },
                { "Realname", SoftEtherValueType.UnicodeString, realName },
                { "Note", SoftEtherValueType.UnicodeString, note },
                { "ExpireTime", expireTime },
                { "AuthType", (int)AuthType.Password },
                { "HashedKey", hashPair.Hash },
                { "NtLmSecureHash", hashPair.SaltedHash }
            };

            var rawData = _softEther.CallMethod("CreateUser", requestData);

            return(HubUser.Deserialize(rawData));
        }