<attestto-verify>
Client-side document verification. Drop a PDF and get hash, signatures, forensic audit results, and a trust level — all without leaving the browser.
Basic usage
<attestto-verify></attestto-verify> That is a fully functional verifier. Every attribute below is optional.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
hash | string | — | Pre-computed SHA-256 hash to verify against. If provided, the component compares the file hash to this value. |
allow-plugins | boolean | true | Enable or disable the plugin system. Set to false to use only the built-in verification pipeline. |
theme | "light" | "dark" | "light" | Color scheme for the component. Can also be controlled with CSS custom properties. |
root-ca | string | — | URL to a custom root CA certificate bundle (PEM). Used to validate signer certificates against your own trust store. |
<attestto-verify hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" allow-plugins="true" theme="dark" root-ca="https://example.com/ca-bundle.pem" ></attestto-verify>
What it does
When a user drops a PDF onto the component, the verification pipeline runs four stages:
Hash — Computes a SHA-256 hash of the entire file. If a hash attribute is set, compares the result and reports match/mismatch.
Signatures — Detects and verifies PAdES and PKCS#7 digital signatures. Extracts signer names, certificates, timestamps, and chain validity.
Forensic audit — Scans for JavaScript injection, OpenAction scripts, embedded executables, form actions pointing to external URLs, and encryption flags.
Plugins — If enabled, passes results through registered plugins (DID resolution, trust registries, blockchain anchors) to elevate the trust level.
Events
The component dispatches Custom Events that bubble and cross Shadow DOM boundaries:
| Event | Detail | When |
|---|---|---|
verification-started | { fileName: string, fileSize: number } | A file is dropped or selected and processing begins. |
verification-complete | { hash: string, signatures: Signature[], plugins: PluginResult[] } | All verification stages have finished. |
Listening for events
const verifier = document.querySelector('attestto-verify') verifier.addEventListener('verification-started', (e) => { console.log('Processing:', e.detail.fileName) console.log('Size:', e.detail.fileSize, 'bytes') }) verifier.addEventListener('verification-complete', (e) => { const { hash, signatures, plugins } = e.detail console.log('SHA-256:', hash) console.log('Signatures found:', signatures.length) // Check trust level const trusted = signatures.some(s => s.trustLevel === 'trusted') if (trusted) { console.log('Document is trusted') } // Send hash to your backend for recording fetch('/api/verify', { method: 'POST', body: JSON.stringify({ hash, signatureCount: signatures.length }) }) })
See also
- <attestto-sign> — sign documents with a DID wallet
- Theming — customize every visual element
- Plugins — extend the verification pipeline
- Composables — headless API for full control
- Playground — try it live