public RPCClient(string ipAddress, string strEndPoint, ProtocolSequenceType protocolSequence, AuthenticationLevelType authenticationLevelType, SecurityProviderType securityProviderType, string userName, string password) { if (protocolSequence == ProtocolSequenceType.ncacn_np) { RPCWorker = new RPCWorker(ipAddress, strEndPoint, userName, password); } else if (protocolSequence == ProtocolSequenceType.ncacn_ip_tcp) { RPCWorker = new RPCWorker(ipAddress, int.Parse(strEndPoint), userName, password, authenticationLevelType, securityProviderType); } else { throw new Exception("no Support ProtocolSequenceType"); } if (authenticationLevelType != AuthenticationLevelType.NONE && authenticationLevelType != AuthenticationLevelType.CONNECT && authenticationLevelType != AuthenticationLevelType.PKT) { throw new Exception("no Support authenticationLevelType"); } if (securityProviderType != SecurityProviderType.NONE && securityProviderType != SecurityProviderType.WINNT) { throw new Exception("no Support SecurityProviderType"); } }
public RPCWorker(string strIpAddress, int destinationPort, string userName, string password, AuthenticationLevelType authenticationLevelType, SecurityProviderType securityProviderType) { RpcTransport = new RpcTransportOnTcp(strIpAddress, destinationPort); SecurityProviderType = securityProviderType; AuthenticationLevelType = authenticationLevelType; if (SecurityProviderType == SecurityProviderType.WINNT) { NTLMClient = new NTLMClient(); } UserName = userName; Password = password; }
public static byte GetByte(this AuthenticationLevelType t) { return((byte)t); }
public RPCWorker(string ipAddress, string strNamePipe, string userName, string password) { RpcTransport = new RpcTransportOnPipe(ipAddress, strNamePipe, userName, password); SecurityProviderType = SecurityProviderType.NONE; AuthenticationLevelType = AuthenticationLevelType.NONE; }