Is your feature request related to a problem? Please describe.
The class JWTEncryptionPreferences has a private IPrivateKeyDecryptor field (privateKeyDecryptor) that is instantiated immediately with BCPrivateKeyDecryptor(). Although it is possible to override the IPrivateKeyDecryptor later via a call to boxConfig.setPrivateKeyDecryptor, by the time this becomes possible, BCPrivateKeyDecryptor() has already been instantiated. BCPrivateKeyDecryptor imports BouncyCastleProvider, which we exclude from dependencies to ensure that only FIPS-compliant BouncyCastle libraries are present, resulting in a failure.
Describe the solution you'd like
It would be helpful if the instantiation of JWTEncryptionPreferences became more configurable. For example, moving this instantiation to a default constructor while allowing an alternative constructor, or utilizing interfaces to make it easier to override the functionality altogether.
Describe alternatives you've considered
- Allowing
BouncyCastleProvider in just for the sake of not receiving compilation-time errors.
- Implementing a fake
BouncyCastleProvider to "trick" the compiler.
- Using reflection.
Is your feature request related to a problem? Please describe.
The class
JWTEncryptionPreferenceshas a privateIPrivateKeyDecryptorfield (privateKeyDecryptor) that is instantiated immediately withBCPrivateKeyDecryptor(). Although it is possible to override theIPrivateKeyDecryptorlater via a call toboxConfig.setPrivateKeyDecryptor, by the time this becomes possible,BCPrivateKeyDecryptor()has already been instantiated.BCPrivateKeyDecryptorimportsBouncyCastleProvider, which we exclude from dependencies to ensure that only FIPS-compliant BouncyCastle libraries are present, resulting in a failure.Describe the solution you'd like
It would be helpful if the instantiation of
JWTEncryptionPreferencesbecame more configurable. For example, moving this instantiation to a default constructor while allowing an alternative constructor, or utilizing interfaces to make it easier to override the functionality altogether.Describe alternatives you've considered
BouncyCastleProviderin just for the sake of not receiving compilation-time errors.BouncyCastleProviderto "trick" the compiler.