Mobile agent is a new distributed computing technology. Constructing electronic commerce system with this technology can make full use of the advantages of mobile agent. But there are several tough problems should solve.First is the security of mobile agent system, especially the malicious host problem; Second is the fair exchange problem in electronic commerce. This paper puts forward a solution using JavaCard. It describes how JavaCard supply secure execution environment for mobile agent and solve the pro...