## 2 Related Work  
5G will provide enhanced Mobile Broadband, ultra-reliable low latency communications, massive machine-type communications to support augmented reality, virtual reality, eHealth systems and smart cities [2; 6]. With D2D communications used as an underlay technology in 5G, its legacy security solutions for Long-Term Evolution (LTE) will be inadequate to address 5G-enabled D2D communications. [PERSON] et al. [16] proposed a secure data sharing protocol for a UE to access SP services in Long-Term Evolution Advanced (LTE-Advanced) network. It provided mutual authentication, non-repudiation, traceability, data confidentiality and integrity. In [17], the authors investigated security and privacy for D2D communications using LTE-D2D architecture and applications and proposed security solutions to address application and physical layers. This work was based on Fourth Generation (4G) architectures and old D2D communications technologies. In [19], the authors explored key distribution in D2D communications and proposed a lightweight key distribution scheme using acceleration sensors, introducing a lightweight extreme points extraction and filtering algorithm to extract extreme points for key generation. In [20], the authors proposed a universal authentication and key agreement protocol for D2D communications, providing privacy-preserving, session key generation and mutual authentication between D2D users using different scenarios. [PERSON] et al. [21] proposed an anonymous authentication and key agreement secure protocol for D2D communications, providing mutual authentication, session key, real identity leakage prevention and secure communications. However, service access authorization and data security were not covered. In [22], the authors introduced a new privacy-preserving security architecture for a fog computing model with the cooperative D2D communication support and proposed three lightweight anonymous authentication protocols to support three distinct circumstances in D2D-Aided fog computing to secure IoT applications. [PERSON] et al. [23] explored the security issues raised as a result of emerging IoT technology with 5G. They then proposed secure D2D communication based on Elliptic Curve Cryptography (ECC) and lightweight authenticated encryption with associated data ciphers to address IoT devices' security. It mainly covered IoT security issues when emerged with D2D communications, not focusing on D2D specific scenarios or service authorization. [PERSON] et al. [24] discussed 5G-enabled Vehicular ad hoc networks (VANETs) security related issues and then proposed a hybrid D2D message authentication scheme for D2D-VANETs, providing mutual authentication for vehicle-to-vehicle communication. In [25], performance and security issues e-health IoT devices are explored and a new mutual authentication protocol for m-health systems based on D2D communication to protect data shared between IoT devices is proposed. [PERSON] et al. [26] investigated D2D group communication security and proposed a dynamic group key agreement protocol to provide a constant-round authentication in D2D group communications, whereby the D2D users communicate and authenticate without NodeB or base station. In [18], the authors explored authentication and key management for D2D/5G communications and proposed a framework based on the physical layer that provides entity authentication and key establishment solution to address the related issues. [PERSON] et al. [27] also investigated physical security for D2D communications. Then, they proposed an access selection scheme for D2D users to protect cellular users against eavesdropping, using jamming techniques to interrupt the eavesdropper, and an optimization method to prove optimal threshold and developed an iterative algorithm to determine the optimal threshold. [PERSON] et al. [28] explored communication delay and network capacity issues. They proposed a security and energy-aware collaborative task offloading for D2D communications.