CommandType

public protocol CommandType

SmartCard Application Protocol Data Unit - Command

  • Returns bytes in the command body. If this APDU has no body, this property should return nil

    Declaration

    Swift

    var data: Data? { get }
  • ne

    Returns the maximum number of expected data bytes in a response APDU (Ne/Le). 0 = unlimited/unknown, nil = no output expected

    Declaration

    Swift

    var ne: Int? { get }
  • nc

    Returns the number of data bytes in the command body (Nc) or 0 if this APDU has no body. This call should be equivalent to self.data.count.

    Declaration

    Swift

    var nc: Int { get }
  • cla

    Returns the value of the class byte CLA.

    Declaration

    Swift

    var cla: UInt8 { get }
  • ins

    Returns the value of the instruction byte INS.

    Declaration

    Swift

    var ins: UInt8 { get }
  • p1

    Returns the value of the parameter byte P1.

    Declaration

    Swift

    var p1: UInt8 { get }
  • p2

    Returns the value of the parameter byte P2.

    Declaration

    Swift

    var p2: UInt8 { get }
  • Serialized APDU message

    Declaration

    Swift

    var bytes: Data { get }
  • toLogicalChannel(channelNo:) Extension method

    Convert a Command to be send on a given channel No

    Throws

    CardError or APDU.Error

    Declaration

    Swift

    public func toLogicalChannel(channelNo: UInt8) throws -> CommandType

    Parameters

    channelNo

    The channel number. Must be < 20.

    Return Value

    Command for channel