From a4016afd7c9f4cd27c4eab7a8426cd641e1c832d Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 24 Oct 2018 12:22:48 +0530 Subject: [PATCH] Model: Interface: Add a public key computed property --- WireGuard/WireGuard/Model/Configuration.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WireGuard/WireGuard/Model/Configuration.swift b/WireGuard/WireGuard/Model/Configuration.swift index b430c8f..3cc59af 100644 --- a/WireGuard/WireGuard/Model/Configuration.swift +++ b/WireGuard/WireGuard/Model/Configuration.swift @@ -21,6 +21,10 @@ struct InterfaceConfiguration: Codable { var mtu: UInt64? = nil var dns: [DNSServer] = [] + var publicKey: Data { + return Curve25519.generatePublicKey(fromPrivateKey: privateKey) + } + init(name: String, privateKey: Data) { self.name = name self.privateKey = privateKey