• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spiffe / java-spiffe / 43248597987
89%
master: 98%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 12 Nov 2026 03:32PM UTC
Jobs 1
Files 51
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Nov 2026 03:30PM UTC coverage: 88.56% (+0.3%) from 88.31%
43248597987

push

github

maxlambrecht
feat(bundle): add marshal methods to X509Bundle and JwtBundle

X509Bundle and JwtBundle could be parsed from PEM certificates and from
an RFC 7517 JWKS document, but there was no way to serialize them back.
Code that obtains a bundle from an X509Source or a JwtSource and needs
to store it, pass it to another process, or serve it as a JWKS had to
write the encoding by hand, including the JWK curve lookup for EC keys.
go-spiffe exposes the same operation as Bundle.Marshal in its x509bundle
and jwtbundle packages.

Add X509Bundle.marshal(), which writes each X.509 authority as a PEM
CERTIFICATE block wrapped at 64 characters, and JwtBundle.marshal(),
which writes the JWT authorities as a JWKS document in UTF-8 JSON with
one public JWK per authority, carrying its key ID and ordered by key ID
so the output is stable. EC keys on a curve that has a JWK name and RSA
keys are supported, matching the key types parse accepts; any other key
raises JwtBundleException. An authority that cannot be DER-encoded
raises X509BundleException. The output of both methods is read back by
the existing parse methods. A bundle without X.509 authorities marshals
to an empty array, which X509Bundle.parse rejects as before; this is
documented on the method.

JwtBundle.parse decoded its input with the platform default charset.
JSON is UTF-8, so decode it as UTF-8: on Java 8 to 17 with a non-UTF-8
default charset, non-ASCII key IDs were corrupted and a marshaled bundle
would not round-trip.

The change only adds methods to final classes, so it is binary
compatible. The core README documents the new methods and the changelog
lists them under Unreleased.

Fixes #508

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>

534 of 677 branches covered (78.88%)

Branch coverage included in aggregate %.

1951 of 2129 relevant lines covered (91.64%)

3.66 hits per line

Coverage Regressions

Lines Coverage ∆ File
4
95.16
2.23% io/spiffe/bundle/jwtbundle/JwtBundle.java
2
96.05
2.95% io/spiffe/bundle/x509bundle/X509Bundle.java
Jobs
ID Job ID Ran Files Coverage
1 43248597987.1 12 Nov 2026 03:32PM UTC 51
88.56
GitHub Action Run
Source Files on build 43248597987
  • Tree
  • List 51
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #43248597987
  • 1f11e44c on github
  • Prev Build on main (#43244020454)
  • Next Build on main (#43249672019)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc