As a new networking paradigm, opportunistic networking communications have great vision in animal migration tracking, mobile social networking, network communications in remote areas and intelligent transportation, and so on. Opportunistic networks are one of the evolutionary mobile ad hoc networks, whose communication links often suffer from frequent disruption and long communication delays. Therefore, many opportunistic forwarding protocols present major security issues, and the design of opportunistic networks faces serious challenges such as how to effectively protect data confidentiality and integrity and how to ensure routing security, privacy, cooperation, and trust management. In this paper, we first systematically describe the security threats and requirements in opportunistic networks; then propose a general security architecture of opportunistic networks; and then make an in‐depth analysis on authentication and access control, secure routing, privacy protection, trust management, and incentive cooperation mechanisms; and at the same time, we present a comparison of various security and trust solutions for opportunistic networks. Finally, we conclude and give future research directions. Copyright © 2014 John Wiley & Sons, Ltd.