TSA Signature Creation
To ensure the integrity and authenticity of the metadata at a specific point in time, a trusted timestamp must be applied to the metadata signature. This process, known as Timestamp Authority (TSA) confirmation, provides cryptographic proof that the data existed before a given time.
Overview
TSA signatures serve critical functions in Liccium:
- Temporal Proof: Demonstrates when the declaration was made
- Integrity: Ensures the data hasn't been modified after timestamping
- Non-repudiation: Provides irrefutable proof of timing
- Compliance: Meets regulatory requirements for timestamped declarations
What is a Timestamp Authority?
A Timestamp Authority (TSA) is a trusted third party that provides cryptographic timestamps. These services use RFC 3161 standard to create tamper-evident timestamps that can be verified independently.
Free TSA Service: Liccium documentation references FreeTSA.org as an example service. This is a free, public TSA service that can be used for testing and development purposes.
Prerequisites
Before creating TSA signatures, ensure you have:
Required Tools
- ✓ OpenSSL installed
- ✓ curl or similar HTTP client
- ✓ Access to a TSA service
- ✓ Your metadata JSON prepared
Previous Steps
- ✓ Certificate signature created
- ✓ Metadata properly formatted
- ✓ .well-known/did.json deployed
- ✓ Understanding of the metadata structure
The TSA Signing Process
Step 1: Prepare Your Data
First, prepare your metadata in JSON format. This should be the same metadata used for certificate signing:
Code(bash)
Example with real metadata:
Code(bash)
Step 2: Create the Timestamp Request
Generate a hash of your data and create a timestamp request:
Code(bash)
This command:
- Creates a SHA-256 hash of your data
- Generates a timestamp query request
- Saves it to
request.tsq
Step 3: Submit to TSA Service
Submit your timestamp request to the TSA service:
Code(bash)
Alternative TSA Services: While FreeTSA is used as an example, you can use other TSA services. Commercial options include DigiCert, Sectigo, and others. Replace the URL with your preferred TSA service endpoint.
Step 4: Verify the Response
The resulting response.tsr
file contains a cryptographic timestamp. You can verify it using:
Code(bash)
Expected output should include:
- Status: Granted
- Timestamp and serial number
- TSA certificate information
Complete Implementation Example
Here's a complete script that demonstrates the entire TSA signature process:
Code(bash)
Integration with Node.js
You can also integrate TSA signature creation into your Node.js application:
Code(javascript)
TSA Service Options
Free Services
- FreeTSA.org: Free public TSA service (good for testing)
- DigiCert Free TSA: Limited free tier available
Commercial Services
- DigiCert: Enterprise-grade TSA services
- Sectigo: Commercial timestamp services
- GlobalSign: Professional TSA solutions
Production Considerations: For production use, consider using a commercial TSA service that offers:
- SLA guarantees
- Higher availability
- Customer support
- Audit trails
Verification and Validation
To verify a TSA signature later:
Code(bash)
Complete Declaration Example
Here's how the final declaration with both certificate and TSA signatures looks:
Code(javascript)
Troubleshooting
Common issues and solutions:
Issue | Cause | Solution |
---|---|---|
TSA request fails | Network connectivity or service down | Check TSA service status and network |
Invalid timestamp format | Incorrect OpenSSL version or parameters | Verify OpenSSL version and command syntax |
Base64 encoding issues | Line breaks in encoded output | Use -w 0 flag with base64 command |
Response verification fails | Corrupted response or wrong CA cert | Re-request timestamp and verify CA certificate |
Next Steps
With your TSA signature created:
- Test your complete declaration with the Declaration API
- Implement error handling for production use
- Monitor TSA service availability and have fallback options
- Set up automated certificate and TSA signature renewal
Your metadata now has both cryptographic authenticity (certificate signature) and temporal proof (TSA signature), providing complete verification capabilities for Liccium declarations.