Implementing attestation verification
This guide walks through implementing verification of VisualSign parser responses. Before trusting any parsed transaction data, your wallet must verify the attestation to confirm it came from a genuine enclave running the expected code. For background on why verification matters and how the security model works, see Security Model.Prerequisites
- Understanding of VisualSign’s security model
- Access to the VisualSign Verifier Library (recommended) or ability to implement verification from scratch
- A PCR allowlist for the parser version you’re integrating with
Verification levels
Choose the level of verification appropriate for your security requirements:| Level | Verifies | Use Case |
|---|---|---|
| Level 1 | Signature only | Development and testing |
| Level 2 | Signature + PCRs | Production deployments |
| Level 3 | Signature + PCRs + Manifest | High-security environments |
Level 1: Signature verification
Verify the parser’s P256 signature on the response.Level 2: Boot attestation
Verify the enclave boot measurements (PCRs) to confirm the expected code is running.Level 3: Manifest verification
Verify the exact application binary for complete supply chain verification.Step-by-step implementation
Step 1: Extract attestation
The parser includes attestation in its responses:Step 2: Decode CBOR
AWS attestation documents use CBOR encoding:Step 3: Verify certificate chain
The attestation includes an X.509 certificate chain signed by AWS:Step 4: Verify PCR values
Check Platform Configuration Registers against your allowlist:Step 5: Extract public key
Only extract the public key after successful attestation verification:Complete example
PCR management
Updating your allowlist
When the parser is updated, PCR values change. Follow this process:- Subscribe to parser release announcements
- Verify new PCR values against published hashes
- Add new PCRs to your allowlist
- Deploy to production
- Remove old PCRs after migration completes
Supporting multiple versions
During migrations, support multiple PCR sets:Monitoring
Track verification metrics in production:Troubleshooting
PCR mismatch
- Parser was updated and your allowlist needs updating
- You’re connecting to a different environment (staging vs production)
- Check the parser releases for current PCR values
Certificate chain invalid
- Check for clock skew on your system
- Verify certificates haven’t expired
- Ensure network connectivity for CRL checks
Signature verification failed
- Confirm the message being verified matches what was signed
- Check you’re using the correct public key from the attestation
- Verify the signature format (ASN.1 DER encoding)
Debug commands
Check current PCR values on the enclave:Resources
- Security Model - Understanding the trust architecture
- AWS Nitro Enclaves Documentation
- CBOR RFC 8949
- VisualSign Verifier Library