Skip to content

Conversation

@kevinherron
Copy link
Contributor

Summary

Removed the bcprov-jdk18on (BouncyCastle Provider) dependency from stack-core. It is no longer necessary to install a BouncyCastle security provider to use any of the supported SecurityPolicy values.

Background

Prior to this change, Eclipse Milo depended on BouncyCastle's provider library (bcprov-jdk18on) in addition to its PKIX library (bcpkix-jdk18on). The provider dependency was originally needed because certain cryptographic algorithms used by OPC UA security policies were not available in older Java versions' default security providers.

However, all cryptographic algorithms required by Milo's supported security policies are now available in modern Java (17+) through the built-in JCA/JCE providers:

  • Basic128Rsa15 - RSA/ECB/PKCS1Padding, AES/CBC/NoPadding, HmacSHA1
  • Basic256 - RSA/ECB/OAEPWithSHA-1AndMGF1Padding, AES/CBC/NoPadding, HmacSHA1
  • Basic256Sha256 - RSA/ECB/OAEPWithSHA-1AndMGF1Padding, AES/CBC/NoPadding, HmacSHA256
  • Aes128_Sha256_RsaOaep - RSA/ECB/OAEPWithSHA-1AndMGF1Padding, AES/CBC/NoPadding, HmacSHA256
  • Aes256_Sha256_RsaPss - RSA/ECB/OAEPWithSHA-256AndMGF1Padding, AES/CBC/NoPadding, HmacSHA256

- Add CipherFactory utility for creating JCA-configured ciphers
- Update SecurityAlgorithm to use explicit AlgorithmParameterSpec
- Configure RSASSA-PSS with SHA-256 digest and MGF1, 32-byte salt
- Configure RSA-OAEP with SHA-256 for hash and MGF1
- Centralize cipher initialization in CipherFactory
- Update signature verification to use AlgorithmParameterSpec
- Remove inline cipher creation in ChunkEncoder/ChunkDecoder
- Remove inline cipher creation in UsernameProvider
- Remove inline cipher creation in AbstractIdentityValidator
- Remove `bcprov-jdk18on` dependency
@kevinherron kevinherron added this to the 1.1.0 milestone Nov 4, 2025
@kevinherron kevinherron added stack security dependencies Pull requests that update a dependency file labels Nov 4, 2025
- Add a parameterized test covering all SecurityPolicy/MessageSecurityMode combinations
- Refactor KeyStoreLoader to support both server and client keystores
- Update TestServer to generate endpoints for all security configurations
@kevinherron kevinherron removed the stack label Nov 4, 2025
@kevinherron kevinherron changed the title Replace Bouncy Castle with JCA for security operations Replace Bouncy Castle with JCA for SecurityProvider Nov 4, 2025
@kevinherron
Copy link
Contributor Author

I'm going to pause this while I figure out if the existing and upcoming ECC profiles will require me to bring this dependency right back...

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

Labels

dependencies Pull requests that update a dependency file security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants