public errors

This commit is contained in:
Dmitry Bespalov 2019-09-12 12:22:37 +02:00
parent 5016331872
commit ca5c049bc7
3 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
enum CardError: Error {
public enum CardError: Error {
case wrongPIN(retryCounter: Int)
case unrecoverableSignature
case invalidState

View File

@ -6,6 +6,7 @@ public class KeycardCommandSet {
let secureChannel: SecureChannel
public var info: ApplicationInfo?
public var pairing: Pairing? { get { secureChannel.pairing } set { secureChannel.pairing = newValue }}
public var isSecureChannelOpen: Bool { return secureChannel.open }
public init(cardChannel: CardChannel) {
self.cardChannel = cardChannel

View File

@ -7,4 +7,9 @@ public enum StatusWord: UInt16, Error {
case conditionsOfUseNotSatisfied = 0x6985
case wrongPINMask = 0x63C0
case unknownError = 0x6F00
case pairingIndexInvalid = 0x6A86
case dataInvalid = 0x6A80
case allPairingSlotsTaken = 0x6A84
case alreadyInitialized = 0x6D00
}