Add fake mapping from JKS/PKCS12 KeyStore to WKS for FIPS Compliance #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for two new Java Security properties:
Setting these to "true" will cause wolfJCE to register support for either a
JKS
orPKCS12
KeyStore type. But, if one or both of these are registered it will be a fake mapping which maps down to the WolfSSLKeyStore (WKS
) type internal to wolfJCE.This should not be used in most cases, but can be helpful in scenarios where FIPS compliance is required and there is existing code which calls
KeyStore.getInstance("JKS")
orKeyStore.getInstance("PKCS12")
, but that existing code cannot be changed. This assumes that even though the code can not be changed, the caller/user has the ability to load actual WKS files into those fake "JKS" or "PKCS12" KeyStore objects.With these properties set, loading real JKS or PKCS12 files into their appropriate KeyStore object types will fail with an IOException.
Calling code may wish to dynamically set this to true or false at runtime for a brief period of time. This can be done by setting the properties then refreshing the services in the wolfJCE provider: