加一支 CLI:不必動手機就能問 PDF 有沒有簽章 - #12
Open
mashbean wants to merge 1 commit into
Open
Conversation
app 內的 PDFSignatureScan 要跑一次身分證下載才有答案,而那要先把新版 裝上實機。如果手邊已經有 MyData 的 zip 或 PDF,這支腳本五秒就回答, 判斷邏輯與 app 內那份一致,兩邊答案應該相同。 它只印信封層級的事實——有無簽章、SubFilter、份數、有無 ByteRange, 不解密、不抽文字、不印出文件裡任何一個字;從 zip 解出來的東西也在 finally 裡刪掉,不留在磁碟上。 不需要密碼也能回答,理由寫在檔頭:PDF 標準加密只加密字串與串流,不加密 名稱物件與字典結構,所以 /Type /Sig、/SubFilter、/ByteRange 在加密檔裡 仍是明文。放 PKCS#7 的 /Contents 是字串、會被加密——但這裡不需要它。 latin1 而非 utf8、/ByteRange 單獨出現也算簽了——與 app 內同樣的兩個 判斷,同樣是為了避免「假的沒有簽章」那個方向的錯誤。 已用合成檔雙向驗證:無簽章檔報「沒有找到」、有簽章檔報出 1 份與 adbe.pkcs7.detached。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mashbean
pushed a commit
that referenced
this pull request
Aug 29, 2026
- 欄位對照表:StoredNationalID.label(for:) 原本只認得本 App 自己國民身分證的鍵, 其他發卡者(政府/電信)的鍵(id_number/address/roc_birthday/license_number/msisdn…) 會 fallthrough 成原始機器鍵。新增 fieldLabelTable(大小寫不敏感、精確比對非子字串, 以免誤標)涵蓋常見鍵→本 App 用語;未知鍵仍 fallthrough→ClaimLabel 框成「發卡者自行命名」 而非本 App 用語。這張表也是 設定 對照表分頁的資料來源。 - 信任清單:TrustCenterViewController 分頁一,非同步 TrustListFetcher.fetchAll() 拉 數位發展部信任清單機構(顯示名稱/統一編號/DID 末段),含載入/失敗狀態。 - TrustCenterViewController:UISegmentedControl 切換「信任清單 | 欄位對照表」, 設定 › 信任 進入。SettingsViewController 新增「信任」section + row。 - 13 個 zh-Hant 字串。 全套 backupTWTests 1407 綠;欄位對照表分頁實機 render 核對正確。 (註:id_number 顯示為「統一編號」——ClaimLabel 既有決策:對照實體身分證上印的字樣; 待與使用者確認是否改「身分證字號」。) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app 內的
PDFSignatureScan(#11)要跑一次身分證下載才有答案,而那要先把新版裝上實機。這支腳本讓手邊已有 MyData zip/PDF 的情況下五秒就回答,判斷邏輯與 app 內那份一致。node scripts/check-pdf-signature.mjs ~/Downloads/某個.zip只印信封層級的事實——有無簽章、SubFilter、份數、有無 ByteRange。不解密、不抽文字、不印出文件裡任何一個字;從 zip 解出來的東西在
finally裡刪掉。不需要密碼:PDF 標準加密只加密字串與串流,不加密名稱物件與字典結構,所以
/Type /Sig、/SubFilter、/ByteRange在加密檔裡仍是明文。已用合成檔雙向驗證。
🤖 Generated with Claude Code