Skip to content

feat!: signature collection, canonical ExtractedTicket — release 3.0.0 - #45

Merged
chtitux merged 5 commits into
mainfrom
claude/signature-retrieval-method-8mplxb
Sep 20, 2026
Merged

chtitux merged 5 commits into
mainfrom
claude/signature-retrieval-method-8mplxb

Conversation

@chtitux

@chtitux chtitux commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New ExtractedTicket canonical record (extractTicket): exact signed bytes, signatures, algorithm OIDs and the Level 1 key identity (SignatureKey: issuer + keyId + canonical id label), structured per level. Replaces extractSignedData/ExtractedSignedData.
  • One extraction, used everywhere: verifySignatures, verifyLevel1Signature, verifyLevel2Signature and recoverLevel1PublicKey accept Uint8Array | ExtractedTicket; findKeyInXml gains a SignatureKey overload; Level1KeyProvider.getPublicKey(key, keyAlg?) takes a SignatureKey.
  • SignatureCollector (+ one-shot collectSignatures): classifies scanned QR payloads automatically by issuer + keyId, deduplicates rescans byte-for-byte, and reports unreadable scans as { status: 'invalid' } instead of throwing. Groups store full ExtractedTicket records and feed directly into registry lookup, key recovery and verification.
  • README updated throughout; CHANGELOG carries a "Migrating from 2.0.0" guide (field-by-field mapping table and provider before/after).
  • Release prep: version bumped to 3.0.0 (breaking changes).

The website/ app depends on the published npm dosipas-ts@^2.0.0 and is unaffected; it migrates when it bumps to 3.x.

Test plan

  • npx tsc --noEmit and npm run build pass
  • Full Vitest suite: 179 tests pass, including 11 new collector tests (grouping across the 9 sample tickets, dedup, invalid-scan reporting, ExtractedTicket pass-through, group lookup)

🤖 Generated with Claude Code

https://claude.ai/code/session_01BMYUez7fcvaL34RUjxKZRJ


Generated by Claude Code

New SignatureCollector class and collectSignatures(payloads) helper: feed
each scanned QR payload in, signatures are extracted via extractSignedData
and grouped automatically by Level 1 key identity (securityProviderNum or
securityProviderIA5, plus keyId), with byte-for-byte deduplication of
rescans. Groups plug into findKeyInXml and recoverLevel1PublicKey.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMYUez7fcvaL34RUjxKZRJ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMYUez7fcvaL34RUjxKZRJ
…ation and collection

Replace extractSignedData/ExtractedSignedData with extractTicket/
ExtractedTicket: the same information restructured per level (signedBytes,
signature, keyAlg, signingAlg, plus level2.publicKey) with the payload and
a new SignatureKey identity (issuer + keyId, canonical id label).

The record is now the lingua franca: verifySignatures, verifyLevel1Signature,
verifyLevel2Signature and recoverLevel1PublicKey accept it in place of raw
bytes so a scan pipeline decodes each payload once; findKeyInXml gains a
SignatureKey overload; Level1KeyProvider.getPublicKey takes a SignatureKey.

SignatureCollector stores full ExtractedTicket records (no lossy copy) and
its add() returns { status: 'added' | 'duplicate' | 'invalid' } instead of
throwing — unreadable scans are expected input in a camera loop. New
collector.group(key | id) lookup and signatureKey() helper.

BREAKING CHANGE: extractSignedData/ExtractedSignedData removed;
Level1KeyProvider.getPublicKey signature changed (and keyId is no longer
defaulted to 0). Migration guide from 2.0.0 in CHANGELOG.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMYUez7fcvaL34RUjxKZRJ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMYUez7fcvaL34RUjxKZRJ
@chtitux
chtitux merged commit 4b6c817 into main Sep 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants