setAT method

Future<bool> setAT({
  1. required Uint8List data,
  2. int ne = 0,
  3. int cla = ISO7816_CLA.NO_SM,
})

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.

Implementation

Future<bool> setAT(
    {required Uint8List data,
    int ne = 0,
    int cla = ISO7816_CLA.NO_SM}) async {
  _log.sdVerbose(
      "Sending SET 'AUTHENTICATION TEMPLATE FOR MUTUAL AUTHENTICATION' command to ICC"
      " data='${data.hex()}'"
      " ne=$ne"
      " cla=${cla.hex()}");
  final rapdu = await _transceive(CommandAPDU(
      cla: cla,
      ins: ISO7816_INS.MANAGE_SECURITY_ENVIRONMENT,
      p1: 0xc1,
      p2: 0xa4,
      data: data,
      ne: ne));
  if (rapdu.status != StatusWord.success) {
    throw ICCError(
        "Authentication template failed", rapdu.status, rapdu.data);
  }
  return true;
}