SimulatedBelgianCard class final

A Belgian eID in memory that answers the commands of a real card, to test without a card reader. Pass it wherever a CardTransport goes:

final card = SimulatedBelgianCard(lastName: 'Peeters', pin: '4321');
final eid = await BelgianEidReader(card).read();

Its signatures check only against rootCertificate, not the Belgian roots.

Implemented types

Constructors

SimulatedBelgianCard({String cardNumber = '591000000106', DateTime? validFrom, DateTime? validUntil, String issuingMunicipality = 'Bruxelles', String nationalNumber = '90051512391', String lastName = 'Specimen', String firstNames = 'Alice Marie', String? thirdGivenNameInitial = 'J', String nationality = 'Belge', String birthPlace = 'Namur', String birthDate = '15 MAI 1990', String sex = 'F', BelgianDocumentType documentType = BelgianDocumentType.eid, String streetAndNumber = 'Rue de la Loi 16', String postalCode = '1000', String municipality = 'Bruxelles', Uint8List? photo, Map<int, Object> extraIdentityFields = const {}, String pin = '1234', int appletVersion = 0x18, Duration latency = Duration.zero, String? tamperedLastName, bool cloned = false, bool holderCertificates = true})
A card holding the given data, by default that of a fictional citizen.

Properties

appletVersion → int
The applet version GET CARD DATA reports.
final
hashCode → int
The hash code for this object.
no setterinherited
isInserted → bool
Whether the card is in the reader. If not, transmit throws a CardTransportException.
no setter
isPinVerified → bool
Whether the PIN was verified since the card was inserted.
no setter
latency → Duration
How long each answer takes.
final
name → String
The simulated reader's name.
no setteroverride
pinTriesLeft → int
The PIN tries left before the card blocks.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
simulatedRoot → Uint8List
The same as rootCertificate: a reader trusts it for this card alone.
no setter

Methods

connect() → Future<CardConnection>
Connects to the card, for a CardWatcher or a BelgianEidWatcher.
override
insert() → void
Puts the card back, which resets it but keeps the PIN tries counter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove() → void
Pulls the card out of the reader.
toString() → String
A string representation of this object.
inherited
transmit(Uint8List command) → Future<Uint8List>
Sends command and returns the response, data then status bytes.
override

Operators

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

Static Properties

rootCertificate → Uint8List
The DER root that signs every simulated card. A reader trusts it for the simulated card alone, never for a real one.
no setter
serialNumber → Uint8List
The chip serial number GET CARD DATA and the identity file carry.
final