pairing public

This commit is contained in:
Dmitry Bespalov 2019-09-04 16:45:02 +02:00
parent 3f8ce4fdda
commit 4f3b21efc6
2 changed files with 8 additions and 8 deletions

View File

@ -4,8 +4,8 @@ import CryptoSwift
public class KeycardCommandSet {
let cardChannel: CardChannel
let secureChannel: SecureChannel
var info: ApplicationInfo?
var pairing: Pairing? { get { secureChannel.pairing } set { secureChannel.pairing = newValue }}
public var info: ApplicationInfo?
public var pairing: Pairing? { get { secureChannel.pairing } set { secureChannel.pairing = newValue }}
public init(cardChannel: CardChannel) {
self.cardChannel = cardChannel

View File

@ -1,19 +1,19 @@
struct Pairing {
let pairingKey: [UInt8]
let pairingIndex: UInt8
public struct Pairing {
public let pairingKey: [UInt8]
public let pairingIndex: UInt8
var bytes: [UInt8] {
public var bytes: [UInt8] {
get {
return [pairingIndex] + pairingKey
}
}
init(pairingKey: [UInt8], pairingIndex: UInt8) {
public init(pairingKey: [UInt8], pairingIndex: UInt8) {
self.pairingKey = pairingKey
self.pairingIndex = pairingIndex
}
init(pairingData: [UInt8]) {
public init(pairingData: [UInt8]) {
self.pairingIndex = pairingData[0]
self.pairingKey = Array(pairingData[1...])
}