Skip to content

Commit

Permalink
Add convenience key exchange method for existing keys
Browse files Browse the repository at this point in the history
  • Loading branch information
vzsg committed Apr 14, 2017
1 parent 99e7f00 commit b47e0ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Ed25519/KeyPair.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public final class KeyPair {
return secret
}

public static func keyExchange(publicKey: PublicKey, privateKey: PrivateKey) -> [UInt8] {
let keyPair = KeyPair(publicKey: publicKey, privateKey: privateKey)
return keyPair.keyExchange()
}

public static func keyExchange(publicKey: [UInt8], privateKey: [UInt8]) throws -> [UInt8] {
let keyPair = try KeyPair(publicKey: publicKey, privateKey: privateKey)
return keyPair.keyExchange()
Expand Down

0 comments on commit b47e0ce

Please sign in to comment.