The related techniques and applications of e-commerce have always been the outmost concerned issue for researchers. Particularly, the use of mobile agent is an important technique on the applications of e-commerce. Mobile agent, for its high autonomy and mobility, can move freely in different execution environments, can automatically detect the resided environment, and react accordingly. Finally, the mobile agent can complete the tasks which are assigned by the users. These characteristics help shaping the mobile agent becomes the most suitable for e-commerce applications. It is always risky to transfer confidential information over an open Internet environment. When the mobile agent roams among the hosts over the Internet or exchanges information with others, the users would have concerns whether the mobile agent could be attacked by manipulated hosts or the confidential information that are carried could be stolen and tampered by the others. All these worries make the safety of the mobile agent on the Internet an important issue. This paper proposes a suitable security scheme for the mobile agent. The scheme is consist of a hierarchy structured key management and an access control scheme based on bilinear pairing over elliptic curves. The paper aims to add improvements on the key management and the access control scheme of Volker and Mehrdad and resolves the issue of storage waste by storing the overlapping secret keys of the mobile agent. Based upon the results of the security and performance analysis on this paper, the proposed scheme is proven to protect the mobile agent in an efficient and secure.