Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
consuelita committed Dec 18, 2018
1 parent 620fd88 commit 896d309
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/ReplicantSwift/Polish/PolishClientModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

public class PolishClientModel
{
let controller = PolishController()
public let controller = PolishController()

public var serverPublicKey: SecKey
public var publicKey: SecKey
Expand Down
13 changes: 11 additions & 2 deletions Sources/ReplicantSwift/Polish/PolishServerModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@ import Foundation

public class PolishServerModel
{
let controller = PolishController()
public let controller = PolishController()

public var clientPublicKey: SecKey?
public var publicKey: SecKey
public var privateKey: SecKey


public init?()
public init?(clientPublicKeyData: Data? = nil)
{
controller.deleteKeys()

if let publicKeyData = clientPublicKeyData
{
if let cPublicKey = controller.decodeKey(fromData: publicKeyData)
{
self.clientPublicKey = cPublicKey
}
}

guard let newKeyPair = controller.generateKeyPair()
else
{
Expand Down

0 comments on commit 896d309

Please sign in to comment.