felectronic_dnie 2.0.0
felectronic_dnie: ^2.0.0 copied to clipboard
Flutter plugin for reading and signing with Spanish electronic DNIe (Documento Nacional de Identidad electronico) via NFC.
Changelog #
2.0.0 #
See "Migrating from 1.x" in the README for the changes in one place.
Breaking changes #
timeoutis aDurationon every operation, workflow andDnieSession.probeAndSignreturnsSignedDataand throwsDnieNotDnieErrorinstead of returningnullfor a card that is not a DNIe.stopSign()andDnieSession.stop()end the stopped operation withDnieCancelledError; before, its future never completed.- Requires the 2.0.0 platform interface and implementations; their breaking
changes (
remainingRetriesisint?,CertificateExpiryStatus.describe, noSignedData.fromMap) apply here too.
Added #
DnieSession.signText, the.authand.signingcopies,withCertificate, andreadFullIdentity(),checkReadiness()andprobeAndSign()as session methods.- Re-exports the new shorthand:
isRetryable,isCredentialError,isLastAttempt,isValidNif,displayName,certificateKindand more.
Fixed #
- Whitespace around the CAN and PIN is ignored by every entry point, not only
by
DnieSession. - The platform setup the plugin needs is now documented in the README.
- Through the platform packages: Android reads a real DNIe and waits the full timeout, iOS links and builds under Swift Package Manager, and stopping an operation ends it on both.
1.0.0 #
- NFC card probe, PIN verification, data signing, and certificate reading.
- SIGN (FIRMA) and AUTH (AUTENTICACION) certificate type selection.
- Certificate details and personal data extraction.
- NFC hardware availability check.
DnieSessionbuilder for credential reuse across operations.- Workflow functions:
checkReadiness,readFullIdentity,probeAndSign. - CAN and PIN validators with
DnieValidationErrorenum. - Model extensions:
CertificateInfoX,SignedDataX,NfcStatusX,PersonalDataX. NfcStatusTypeandCertificateExpiryStatusenum-based status reporting.- Full X.509 certificate parsing via
parsedCertificateextension. - Typed error hierarchy with 14 error subclasses including PIN retry count.