The implementation of Mobile Ad hoc Networks in numerous domains is necessitated by the fast evolving wireless service requirements as well as deployment demands over the last few decades. The application areas are environmental monitoring, disaster rescue operations, military communications, and other safety-critical sectors.The underlying routing protocol has a considerable impact on the effectiveness of an ad hoc network deployment in a specific situation. MANETs are vulnerable to major security risks that are difficult to combat with current security measures. As a result, several safe routing protocols have been created to improve MANET security. This work proposes a safe and energy-efficient routing mechanism using group key management. Initially, Particle Swarm Optimization (PSO) was adopted for efficient selection of cluster heads and malicious node detection, which aims to establish the trust among connected nodes that can enhance security as every participating node will produce as well as propagate authentic, accurate, and trusted content within the network. Two specialized nodes, dubbed Calculator Key (CK) and Distribution Key (DK), are then responsible for producing, verifying, and distributing secret keys among nodes employing Asymmetric key cryptography. The proposed method is named Optimal Cluster_ Trust Asymmetric Key Management Protocol (OptCH_TAKMP), which is considered an excellent energy-efficient cluster head election process with a securable routing mechanism. It is compared with three state-of-art methods. Simulation results show that proposed OptCH_TAKMP achieves 31.4% of routing overhead, 23% of end-to-end delay, 78.6% of energy efficiency, 94.8% of throughput, 28.2% of average latency, 91.4% of malicious detection rate, and 92.4% of packet delivery ratio, 85.2% of network lifetime, 19.2% of communication cost and 28.6% of trust computation error.