diff options
author | Roopesh Chander <roop@roopc.net> | 2018-10-24 12:22:48 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-10-27 15:13:01 +0530 |
commit | b6d41ec9de7c9d3d4a5eba053b1751acebb3224b (patch) | |
tree | b1b69d45320c04eccb3a01dfb551d19153f8cce3 | |
parent | Crypto: Swift wrapper for the Curve25519 C code (diff) | |
download | wireguard-apple-b6d41ec9de7c9d3d4a5eba053b1751acebb3224b.tar.xz wireguard-apple-b6d41ec9de7c9d3d4a5eba053b1751acebb3224b.zip |
Model: Interface: Add a public key computed property
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r-- | WireGuard/WireGuard/Model/Configuration.swift | 4 |
1 files changed, 4 insertions, 0 deletions
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 |