Skip to content

Set Bouncy Castle as optional feature in Gradle build - #1006

Open
exceptionfactory wants to merge 2 commits into
hierynomus:masterfrom
exceptionfactory:bouncy-castle-feature-1
Open

exceptionfactory wants to merge 2 commits into
hierynomus:masterfrom
exceptionfactory:bouncy-castle-feature-1

Conversation

@exceptionfactory

@exceptionfactory exceptionfactory commented Mar 20, 2025 •

Copy link
Copy Markdown
Contributor

This pull request assigns Bouncy Castle dependencies to the bouncyCastle feature variant in the Gradle build. Assigning these dependencies to a variant results in marking the libraries as optional dependencies in the published Maven configuration.

This change builds on recent efforts to move away from and isolate use of the Bouncy Castle library throughout the project.

This could be considered a breaking change for consumers that rely on inclusion of Bouncy Castle as a transitive dependency and require features that Bouncy Castle provides.

Direct features include reading PEM key files encrypted using historical methods other than PKCS8, and reading PuTTY Key Version 3 files that require the Argon2 key derivation function. Indirect features that depend on the Bouncy Castle security provider include support for Ed25519 when running on Java 14 or earlier, and support for X25519 when running on Java 10 or earlier. All of these features will continue to work when Bouncy Castle dependencies are declared directly.

The alternative to this change is retaining the current dependency requirements, and requiring consumers to exclude the Bouncy Castle transitive dependencies.

@hierynomus

Copy link
Copy Markdown
Owner

I'll keep this one on the backlog for a moment. There's a ton of other changes pending, let's get them out first. This might warrant a slightly bigger version jump.

@exceptionfactory

Copy link
Copy Markdown
Contributor Author

Thanks @hierynomus, I agree that this change has a larger potential impact and could warrant a major version adjustment. Revisiting this later after other incremental releases sounds good!

- Added bouncyCastle feature for marking Bouncy Castle libraries as optional
@exceptionfactory
exceptionfactory force-pushed the bouncy-castle-feature-1 branch from f58a17f to 1512c6e Compare August 16, 2025 16:37
@exceptionfactory

Copy link
Copy Markdown
Contributor Author

@hierynomus Do you have any additional thoughts on the feature variant approach proposed, making Bouncy Castle and optional dependency? If you would prefer to keep the current approach, I can close this one.

@hierynomus

Copy link
Copy Markdown
Owner

No I like the approach here. Let's first release a new version with all the accumulated fixes and then this in a new version to isolate the potential breakage

@exceptionfactory

Copy link
Copy Markdown
Contributor Author

No I like the approach here. Let's first release a new version with all the accumulated fixes and then this in a new version to isolate the potential breakage

Sounds like a plan, thanks for following up on this!

@github-actions github-actions Bot added dependencies Dependency updates enhancement New feature or request labels Oct 13, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.58%. Comparing base (a95d007) to head (77f0bc5).
⚠️ Report is 20 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1006      +/-   ##
============================================
+ Coverage     71.12%   71.58%   +0.45%     
- Complexity     1647     1684      +37     
============================================
  Files           229      230       +1     
  Lines          8333     8378      +45     
  Branches        714      720       +6     
============================================
+ Hits           5927     5997      +70     
+ Misses         2034     2010      -24     
+ Partials        372      371       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

dependencies Dependency updates enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants