A mobile ad hoc network MANET is a self-organized wireless network where mobile nodes can communicate with each other without reliance on a centralized authority. Security solutions for traditional networks are not suitable for MANETs due to the infrastructureless nature and the absence of centralized administration. Key management through accessing trusted authorities or centralized servers are infeasible for MANETs due to the absence of any infrastructure, frequent mobility, and wireless link instability. In this paper we propose an on demand, self-organized, public key management for MANETs based on the existence of a web of trust between mobile nodes forming the network. The proposed scheme allows each user to create its public key and the corresponding private key, to issue certificates to neighboring nodes, and to perform public key authentication without relying on any centralized authority. Simulation results show that the proposed scheme is efficient and highly robust in stationary networks and networks with low to high mobility.