Model: Interface: Add a public key computed property

This commit is contained in:
Roopesh Chander 2018-10-24 12:22:48 +05:30
parent 1f166c8d3e
commit a4016afd7c
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ struct InterfaceConfiguration: Codable {
var mtu: UInt64? = nil var mtu: UInt64? = nil
var dns: [DNSServer] = [] var dns: [DNSServer] = []
var publicKey: Data {
return Curve25519.generatePublicKey(fromPrivateKey: privateKey)
}
init(name: String, privateKey: Data) { init(name: String, privateKey: Data) {
self.name = name self.name = name
self.privateKey = privateKey self.privateKey = privateKey