Response
public struct Response
An APDU response per ISO/IEC 7816-4. It consists of a conditional body and a two byte trailer. This class does not attempt to semantically verify an APDU response.
See also
ResponseType
-
Initialize APDU response with raw Data.
Declaration
Swift
public init(apdu data: Data) throws
Parameters
data
the raw APDU response data
-
Success response [0x9000]
Declaration
Swift
public static let OK: APDU.Response
-
Convenience initializer for APDU repsonses that come in three parts
Throws
APDU.Error
Declaration
Swift
public init(body: Data, sw1: UInt8, sw2: UInt8) throws
Parameters
body
response body, may be empty
sw1
the SW1 command processing byte
sw2
the SW2 command processing byte
-
The response body
See also
ResponseType.data
Declaration
Swift
public var data: Data? { get }
-
The response body length
See also
ResponseType.nr
Declaration
Swift
public var nr: Int { get }
-
The response status word - upper byte
See also
ResponseType.sw1
Declaration
Swift
public var sw1: UInt8 { get }
-
The response status word - lower byte
See also
ResponseType.sw2
Declaration
Swift
public var sw2: UInt8 { get }
-
The response status word
See also
ResponseType.sw
Declaration
Swift
public var sw: UInt16 { get }