SimulatedIcaoChip class final

A passport or identity card chip in memory that answers the commands of a real one, to test without a document or reader. Pass it wherever a CardTransport goes:

final chip = SimulatedIcaoChip(lastName: 'PEETERS', can: '654321');
final document = await IcaoReader(chip).read(
  access: IcaoAccessKey.can('654321'),
);

It holds the data of a fictional holder of Utopia, the state of the ICAO specimens, signed by a made-up CSCA that an IcaoReader trusts for simulated chips only.

Implemented types

Constructors

SimulatedIcaoChip({IcaoDocumentType type = IcaoDocumentType.passport, String? documentNumber, String issuingState = 'UTO', String nationality = 'UTO', String lastName = 'SPECIMEN', String firstNames = 'ALICE MARIE', PartialDate? birthDate, Sex sex = Sex.female, DateTime? expiryDate, String? birthPlace = 'ZENITH<UTOPIA', String? address = 'AVENUE DES NATIONS 1<1000 ZENITH<UTOPIA', String? issuingAuthority = 'MINISTRY OF FOREIGN AFFAIRS', DateTime? issueDate, String? personalNumber, Uint8List? photo, IcaoFaceEncoding faceEncoding = IcaoFaceEncoding.iso19794, String can = '123456', SimulatedChipAccess access = SimulatedChipAccess.paceAndBac, SimulatedChipProof proof = SimulatedChipProof.chipAuthentication, bool cloned = false, IcaoDataGroup? tamperedGroup, Duration latency = Duration.zero})
A chip holding the given data, by default that of a fictional citizen.

Properties

access → SimulatedChipAccess
The protocols that open the chip.
final
birthDate → PartialDate
The date of birth.
final
can → String
The card access number, for PACE.
final
canKey → IcaoAccessKey
The key that opens the chip from its CAN.
no setter
cloned → bool
Whether the chip is a copy that fails its proof.
final
documentNumber → String
The document number.
final
expiryDate → DateTime
The date of expiry.
final
faceEncoding → IcaoFaceEncoding
The encoding of the face in DG2.
final
hashCode → int
The hash code for this object.
no setterinherited
isInserted → bool
Whether the chip is on the reader. If not, transmit throws a CardTransportException.
no setter
isSecured → bool
Whether a secure messaging session is open.
no setter
latency → Duration
The delay before each answer.
final
mrzKey → IcaoAccessKey
The key that opens the chip from its MRZ.
no setter
name → String
The name of the terminal, such as the name of the reader.
no setteroverride
proof → SimulatedChipProof
How the chip proves it is genuine.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
simulatedCsca → IcaoCertificate
The made-up CSCA of the simulated document.
no setter
type → IcaoDocumentType
The kind of document: a passport (TD3) or an identity card (TD1).
final

Methods

connect() → Future<CardConnection>
Connects to the chip, for a CardWatcher or an IcaoWatcher.
override
insert() → void
Puts the document back, which resets the chip.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove() → void
Takes the document off the reader.
toString() → String
A string representation of this object.
inherited
transmit(Uint8List bytes) → Future<Uint8List>
Sends command and returns the response, data then status bytes.
override

Operators

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