|
| 1 | +# Overview of Differences |
| 2 | + |
| 3 | +This chapter provides a high-level comparison between Bouncy Castle and the |
| 4 | +wolfSSL Java providers (wolfJCE and wolfJSSE) to help frame the migration effort. |
| 5 | + |
| 6 | +## Architecture Comparison |
| 7 | + |
| 8 | +### Bouncy Castle |
| 9 | + |
| 10 | +Bouncy Castle is a pure-Java cryptographic library that includes both a |
| 11 | +lightweight crypto API and standard JCE/JSSE provider implementations. All |
| 12 | +cryptographic operations are implemented in Java. |
| 13 | + |
| 14 | +### wolfJCE / wolfJSSE |
| 15 | + |
| 16 | +wolfJCE and wolfJSSE are JNI-based providers that wrap the native wolfCrypt and |
| 17 | +wolfSSL C libraries, respectively. Cryptographic operations are performed in |
| 18 | +native code, with Java providing the JCE/JSSE interface layer. |
| 19 | + |
| 20 | +## Provider Registration |
| 21 | + |
| 22 | +Both Bouncy Castle and wolfJCE/wolfJSSE follow the standard Java Security |
| 23 | +architecture for provider registration. The primary difference is in the |
| 24 | +provider class names and the requirement to load native libraries for wolfSSL |
| 25 | +providers. |
| 26 | + |
| 27 | +### Bouncy Castle Provider Registration |
| 28 | + |
| 29 | +```java |
| 30 | +import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| 31 | +import org.bouncycastle.jsse.provider.BouncyCastleJsseProvider; |
| 32 | + |
| 33 | +Security.addProvider(new BouncyCastleProvider()); |
| 34 | +Security.addProvider(new BouncyCastleJsseProvider()); |
| 35 | +``` |
| 36 | + |
| 37 | +### wolfJCE / wolfJSSE Provider Registration |
| 38 | + |
| 39 | +```java |
| 40 | +import com.wolfssl.provider.jce.WolfCryptProvider; |
| 41 | +import com.wolfssl.provider.jsse.WolfSSLProvider; |
| 42 | + |
| 43 | +Security.addProvider(new WolfCryptProvider()); |
| 44 | +Security.addProvider(new WolfSSLProvider()); |
| 45 | +``` |
| 46 | + |
| 47 | +## Supported Algorithms |
| 48 | + |
| 49 | +wolfJCE and wolfJSSE support a focused set of algorithms commonly required |
| 50 | +for modern applications and FIPS 140-3 compliance. While Bouncy Castle supports |
| 51 | +a very wide range of algorithms including many legacy and niche options, |
| 52 | +wolfJCE/wolfJSSE focus on widely-used, standards-based algorithms. |
| 53 | + |
| 54 | +Consult the following manuals for the current list of supported algorithms |
| 55 | +and classes: |
| 56 | + |
| 57 | +- [wolfJCE Supported Algorithms and Classes](https://www.wolfssl.com/documentation/manuals/wolfcrypt-jni-jce/chapter06.html) |
| 58 | +- [wolfJSSE Supported Algorithms and Classes](https://www.wolfssl.com/documentation/manuals/wolfssljni/chapter06.html) |
| 59 | + |
| 60 | +## KeyStore Comparison |
| 61 | + |
| 62 | +For FIPS 140-3 deployments, WKS is the recommended KeyStore type since all |
| 63 | +of its internal cryptographic operations use FIPS-approved algorithms from the |
| 64 | +wolfCrypt FIPS module. See Chapter 3 for KeyStore migration details. |
| 65 | + |
0 commit comments