Model: Interface: Add a public key computed property
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user