3.1 KiB
3.1 KiB
ASN.1-Native RFC 3161 Timestamp Token Parsing
Module
Attestor
Status
IMPLEMENTED
Description
Native ASN.1 parsing of RFC 3161 timestamp tokens using System.Formats.Asn1 (no BouncyCastle dependency). Includes request encoding, response decoding, TstInfo extraction, certificate chain parsing, and signature verification. This is the low-level implementation detail behind the known "RFC-3161 TSA Client" entry.
Implementation Details
- Timestamp Service:
src/Attestor/__Libraries/StellaOps.Attestor.Timestamping/AttestationTimestampService.cs(with.Helpers,.Timestamp,.Verifypartials) -- core service handling RFC 3161 timestamp request/response lifecycle. - IAttestationTimestampService:
IAttestationTimestampService.cs-- interface for timestamp operations. - Timestamp Policy:
TimestampPolicy.cs,TimestampPolicyEvaluator.cs,TimestampPolicyResult.cs-- policy evaluation for timestamp requirements. - TSA Certificate Validation:
TsaCertificateStatus.cs-- certificate chain status.TstVerificationStatus.cs-- TstInfo verification result. - Time Correlation:
TimeCorrelationValidator.cs(with.Async,.GapChecks,.Validatepartials) -- validates timestamp consistency across multiple TSA sources.TimeCorrelationPolicy.cs,TimeCorrelationResult.cs,TimeCorrelationStatus.csdefine correlation rules. - Time Consistency:
TimeConsistencyResult.cs-- result of cross-TSA time consistency checks. - Multi-Provider Fallback:
src/Attestor/__Libraries/StellaOps.Attestor.Infrastructure/Timestamping/TsaMultiProvider.cs-- fallback chain across multiple TSA providers. - Configuration:
AttestationTimestampOptions.cs,AttestationTimestampServiceOptions.cs,AttestationTimestampVerificationOptions.cs,AttestationTimestampPolicyContext.cs. - Timestamped Attestation:
TimestampedAttestation.cs-- wraps an attestation with its timestamp token. - Tests:
StellaOps.Attestor/StellaOps.Attestor.Tests/Timestamping/AttestationTimestampServiceTests.cs,AttestationTimestampPolicyTests.cs,TimeCorrelationValidatorTests.cs
E2E Test Plan
- Create a timestamp request for a SHA-256 hash via
AttestationTimestampService, send to a TSA endpoint, and verify the response contains a valid TstInfo with matching hash - Parse an RFC 3161 timestamp token response and verify certificate chain extraction produces valid
TsaCertificateStatus - Verify a timestamp token signature against the TSA certificate and confirm
TstVerificationStatusindicates success - Configure
TimeCorrelationValidatorwith two TSA sources and verifyTimeConsistencyResultpasses when timestamps are within configured gap tolerance - Configure
TimeCorrelationValidatorwith a strict gap threshold and submit timestamps with drift exceeding the threshold, verifyingTimeCorrelationStatusindicates failure - Test
TsaMultiProviderfallback by configuring a primary TSA that fails and a secondary that succeeds, verifying the timestamp is obtained from the fallback provider - Create a
TimestampedAttestationwrapping a DSSE envelope and verify the timestamp token is correctly associated