feat: add RFC 3161 Timestamp Authority support for PKI signing - #620
feat: add RFC 3161 Timestamp Authority support for PKI signing#620SequeI wants to merge 1 commit into
Conversation
Add --tsa-url option to include RFC 3161 timestamps in signature bundles, enabling verification after certificate expiry. Signed-off-by: SequeI <asiek@redhat.com>
|
Let's first revisit at a model igning meeting too before merging |
There was a problem hiding this comment.
--tsa-url on sign key / sign pkcs11-key is dead code on the verify side
The key signer (sign_ec_key.py:130-132, sign_pkcs11.py:190-193) embeds a TSA timestamp in the bundle when --tsa-url is provided, but the key verifier (sign_ec_key.py:_verify_bundle) never reads it — it only checks the cryptographic signature against the public key. There are no certificates involved, so there's no expiry window to anchor with a timestamp.
The timestamp is consumed in the certificate verifier (sign_certificate.py:_verify_certificates), where it's used to set the verification time for chain validation. That path works correctly.
On the flip side, it also proves the signature existed at a specific point in time, regardless of certificates. So if a key is later compromised, a TSA timestamp proves the signature was made before the compromise — the signature can still be trusted.
These were a few questions/thoughts raised while implementing in the Go package
Any thoughts?
| return bundle_pb.TimestampVerificationData( | ||
| rfc3161_timestamps=[ | ||
| bundle_pb.RFC3161SignedTimestamp( | ||
| signed_timestamp=base64.b64encode(response.as_bytes()) |
There was a problem hiding this comment.
The protobuf field is bytes type and protobuf handles serialization. Wrapping it in base64 creates a double-encoding.
Possible to have another look at this?
| ts = ts_data.rfc3161_timestamps[0] | ||
| try: | ||
| response = rfc3161_client.decode_timestamp_response( | ||
| base64.b64decode(ts.signed_timestamp) |
There was a problem hiding this comment.
The protobuf field is bytes type and protobuf handles serialization. Wrapping it in base64 creates a double-encoding.
Possible to have another look at this?
Summary
Add optional --tsa-url flag to key, certificate, pkcs11-key, and pkcs11-certificate signing commands. When provided, the signature bundle includes a trusted timestamp from the specified TSA.
The verifier uses the TSA timestamp (when present) to validate certificate chains, enabling signature verification even after the signing certificate has expired - as long as the signature was created while the certificate was valid.
Closes #603
Checklist