Skip to content

feat: add RFC 3161 Timestamp Authority support for PKI signing - #620

Open
SequeI wants to merge 1 commit into
sigstore:mainfrom
SequeI:addTSA
Open

feat: add RFC 3161 Timestamp Authority support for PKI signing#620
SequeI wants to merge 1 commit into
sigstore:mainfrom
SequeI:addTSA

Conversation

@SequeI

@SequeI SequeI commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

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.

  • Add request_timestamp() and get_timestamp_from_bundle() to sign_sigstore_pb.py
  • Update all PKI signers to accept tsa_url parameter
  • Update certificate verifier to use TSA timestamp for validation
  • Add --tsa-url CLI option to all PKI signing commands
  • Update README and CHANGELOG with documentation

Closes #603

Checklist
  • All commits are signed-off, using DCO
  • All new code has docstrings and type annotations
  • All new code is covered by tests. Aim for at least 90% coverage. CI is configured to highlight lines not covered by tests.
  • Public facing changes are paired with documentation changes
  • Release note has been added to CHANGELOG.md if needed

@SequeI
SequeI requested review from a team as code owners March 6, 2026 15:58
stefanberger
stefanberger previously approved these changes Mar 6, 2026

@stefanberger stefanberger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/model_signing/_signing/sign_sigstore_pb.py Outdated
Add --tsa-url option to include RFC 3161 timestamps in signature bundles,
enabling verification after certificate expiry.

Signed-off-by: SequeI <asiek@redhat.com>
@mihaimaruseac

Copy link
Copy Markdown
Member

Let's first revisit at a model igning meeting too before merging

@sampras343 sampras343 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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?

cc: @SequeI @mihaimaruseac

return bundle_pb.TimestampVerificationData(
rfc3161_timestamps=[
bundle_pb.RFC3161SignedTimestamp(
signed_timestamp=base64.b64encode(response.as_bytes())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discusion pending Label for PRs and Issues that we should discuss at a Model Signing SIG Meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC 3161 Timestamp Authority Support for Certificate Signing

4 participants