Skip to content

Add SPIFFE-based signer#150

Merged
JoshVanL merged 4 commits intodapr:mainfrom
JoshVanL:crypto-spiffe-signer
Mar 24, 2026
Merged

Add SPIFFE-based signer#150
JoshVanL merged 4 commits intodapr:mainfrom
JoshVanL:crypto-spiffe-signer

Conversation

@JoshVanL
Copy link
Copy Markdown
Contributor

Introduce crypto/spiffe/signer, which provides cryptographic signing and verification using the workload's X.509 SVID identity and trust bundles. Supports Ed25519, ECDSA, and RSA key types.

@JoshVanL JoshVanL requested review from a team as code owners March 20, 2026 17:13
Copilot AI review requested due to automatic review settings March 20, 2026 17:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new SPIFFE-based signing/verification utility (crypto/spiffe/signer) intended to let callers sign digests using the workload’s X.509 SVID private key and verify signatures and certificate chains against SPIFFE trust bundles.

Changes:

  • Added crypto/spiffe/signer with signing (Ed25519/ECDSA/RSA), signature verification, and certificate chain-of-trust verification.
  • Added a crypto/spiffe/trustanchors/fake implementation for tests and consumers needing an in-memory trust bundle.
  • Simplified a no-op Watch implementation in trustanchors/multi.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
crypto/spiffe/trustanchors/multi/multi.go Simplifies no-op Watch implementation.
crypto/spiffe/trustanchors/fake/fake.go Adds a fake trust anchors implementation backed by an in-memory X.509 bundle.
crypto/spiffe/signer/signer.go Introduces SPIFFE-based signing and verification APIs, including chain-of-trust verification.
crypto/spiffe/signer/signer_test.go Adds comprehensive tests for signing/verification and chain-of-trust scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Introduce crypto/spiffe/signer, which provides cryptographic signing
and verification using the workload's X.509 SVID identity and trust
bundles. Supports Ed25519, ECDSA, and RSA key types.

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
the cryptographic signature and not the certificate chain of trust.

VerifyCertChainOfTrust now takes a signingTime parameter instead of
using leaf.NotAfter as the verification time. This allows callers to
verify historical signatures using the timestamp of the event, correctly
accepting certificates that were valid at signing time while rejecting
expired certificates used for new signatures.

Switch ECDSA signing from R|S (IEEE P1363) to ASN.1 DER encoding
using SignASN1/VerifyASN1, which is the standard Go/X.509 format.

Signed-off-by: joshvanl <me@joshvanl.dev>
@JoshVanL JoshVanL force-pushed the crypto-spiffe-signer branch from 9d51992 to a9b3133 Compare March 23, 2026 12:33
Signed-off-by: joshvanl <me@joshvanl.dev>
@JoshVanL JoshVanL merged commit 845b395 into dapr:main Mar 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants