ICC class

Defines ISO/IEC-7816 ICC API interface to send commands and receive data.

Constructors

ICC(ComProvider _com)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sm SecureMessaging?
getter/setter pair

Methods

connect() Future<void>
Can throw ComProviderError.
disconnect() Future<void>
Can throw ComProviderError.
externalAuthenticate({required Uint8List data, required int ne, int cla = ISO7816_CLA.NO_SM}) Future<Uint8List>
Sends EXTERNAL AUTHENTICATE command to ICC. ICC should return it's computed authentication data. Can throw ICCError or ComProviderError.
generalAuthenticatePACEstep1({required Uint8List data, int ne = 256, int cla = ISO7816_CLA.COMMAND_CHAINING}) Future<Uint8List>
Sends GENERAL AUTHENTICATE - step 1 command to ICC. ICC should return dynamic authentication data (with encrypted nonce in it). Can throw ICCError or ComProviderError.
generalAuthenticatePACEstep2and3({required Uint8List data, int ne = 256, int cla = ISO7816_CLA.COMMAND_CHAINING}) Future<Uint8List>
Sends GENERAL AUTHENTICATE - step 2 or 3' command to ICC. ICC should return dynamic authentication data (with encrypted nonce in it). Can throw ICCError or ComProviderError.
generalAuthenticatePACEstep4({required Uint8List data, int ne = 256, int cla = ISO7816_CLA.NO_SM}) Future<Uint8List>
Sends GENERAL AUTHENTICATE - step 4' command to ICC. ICC should return dynamic authentication data (with encrypted nonce in it). Can throw ICCError or ComProviderError.
getChallenge({required int challengeLength, int cla = ISO7816_CLA.NO_SM}) Future<Uint8List>
Sends GET CHALLENGE command to ICC and ICC should return challengeLength long challenge. Can throw ICCError or ComProviderError.
internalAuthenticate({required Uint8List data, int p1 = 0x00, int p2 = 0x00, required int ne, int cla = ISO7816_CLA.NO_SM}) Future<Uint8List>
Sends INTERNAL AUTHENTICATE command to ICC. ICC should return it's computed authentication data. Can throw ICCError or ComProviderError.
isConnected() bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBinary({required int offset, required int ne, int cla = ISO7816_CLA.NO_SM}) Future<ResponseAPDU>
Sends READ BINARY command to ICC. It returns ne long chunk of data at offset. Max offset can be 32 766. ne must not overlap offset 32 767. Can throw ICCError if R-APDU returns no data and error status or ComProviderError.
readBinaryBySFI({required int sfi, required int offset, required int ne, int cla = ISO7816_CLA.NO_SM}) Future<ResponseAPDU>
Sends READ BINARY command to ICC. It returns file's ne long chunk of data at offset. File is identified by sfi. Max offset can be 255. Can throw ICCError if R-APDU returns no data and error status or ComProviderError.
readBinaryExt({required int offset, required int ne, int cla = ISO7816_CLA.NO_SM}) Future<ResponseAPDU>
Sends Extended READ BINARY (odd ins 'B1') command to ICC. It returns ne long chunk of data at offset. offset can be greater than 32 767. Can throw ICCError if R-APDU returns no data and error status or ComProviderError.
selectChildDF({required Uint8List childDF, int p2 = 0, int cla = ISO7816_CLA.NO_SM, int ne = 0}) Future<Uint8List?>
Selects child DF by childDF ID. Can throw ICCError or ComProviderError.
selectEF({required Uint8List efId, int p2 = 0, int cla = ISO7816_CLA.NO_SM, int ne = 0}) Future<Uint8List?>
Selects EF under current DF by efId. Can throw ICCError or ComProviderError.
selectFile({required int p1, required int p2, int cla = ISO7816_CLA.NO_SM, Uint8List? data, int ne = 0}) Future<Uint8List?>
Sends SELECT FILE command to ICC. Can throw ICCError or ComProviderError.
selectFileByDFName({required Uint8List dfName, int p2 = 0, int cla = ISO7816_CLA.NO_SM, int ne = 0}) Future<Uint8List?>
Selects file by DF name Can throw ICCError or ComProviderError.
selectFileById({required Uint8List fileId, int p2 = 0, int cla = ISO7816_CLA.NO_SM, int ne = 0}) Future<Uint8List?>
Selects MF, DF or EF by file ID. If fileId is null, then MF is selected. Can throw ICCError or ComProviderError.
selectFileByPath({required Uint8List path, required bool fromMF, int p2 = 0, int cla = ISO7816_CLA.NO_SM, int ne = 0}) Future<Uint8List?>
Selects file by path. If fromMF is true, then file is selected by path starting from MF, otherwise from currentDF. path must not include MF/Current DF ID. Can throw ICCError or ComProviderError.
selectParentDF({int p2 = 0, int cla = ISO7816_CLA.NO_SM, int ne = 0}) Future<Uint8List?>
Selects parent DF under current DF. Can throw ICCError or ComProviderError.
setAT({required Uint8List data, int ne = 0, int cla = ISO7816_CLA.NO_SM}) Future<bool>
Sends SET 'AUTHENTICATION TEMPLATE FOR MUTUAL AUTHENTICATION' command to ICC. ICC if it is ready returns (90 00) or not ready (not 90 00) - throws exception. Can throw ICCError or ComProviderError.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited