Skip to content

Complete digital signature signing + verification (7/7 pass) - #17

Merged
ronaldtse merged 1 commit into
mainfrom
fix/digital-signature-complete
Aug 4, 2026
Merged

Complete digital signature signing + verification (7/7 pass)#17
ronaldtse merged 1 commit into
mainfrom
fix/digital-signature-complete

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Full PKCS#7 detached signing with ByteRange computation

Signing:
- Create signature dict with ByteRange and Contents placeholder
- Insert Contents hex string directly into serialized PDF bytes
- Compute ByteRange with size-adjustment for variable-length values
- Create OpenSSL PKCS#7 detached signature over signed byte range
- Inject hex-encoded signature into Contents placeholder

Verification:
- Parse signed PDF bytes for /ByteRange and /Contents
- Extract signed data using ByteRange offsets
- Parse PKCS#7 DER from hex-encoded Contents
- Verify signature against trusted certificates via OpenSSL
- Return Result structs with signer, valid?, cert_chain
- Return empty array for unsigned documents
@ronaldtse
ronaldtse merged commit 20683fb into main Aug 4, 2026
@ronaldtse
ronaldtse deleted the fix/digital-signature-complete branch August 4, 2026 02:11
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.

1 participant