Class BouncyCastleApprovedModeTest

java.lang.Object
org.apache.kafka.common.security.fips.BouncyCastleApprovedModeTest

public class BouncyCastleApprovedModeTest extends Object
Tests for BouncyCastle FIPS approved-only mode. Based on lobo-packages/cflt-java-fips-test/TestBouncyCastleFIPS.java

This test simulates a FIPS-compliant environment by: - Setting org.bouncycastle.fips.approved_only=true - Removing non-FIPS providers (especially SunJCE) - Loading only BC FIPS, BC JSSE, SUN, and SunSASL providers

Uses the same security.providers mechanism as production Kafka. Tests skip automatically if BC FIPS is not on the classpath.

  • Constructor Details

    • BouncyCastleApprovedModeTest

      public BouncyCastleApprovedModeTest()
  • Method Details

    • setUpAll

      @BeforeAll public static void setUpAll()
    • tearDownAll

      @AfterAll public static void tearDownAll()
    • testFipsStatusReady

      @Test public void testFipsStatusReady() throws Exception
      Test 1: Verify FIPS status is ready. Reference: lobo-packages TestBouncyCastleFIPS.java#L168
      Throws:
      Exception
    • testDigestCiphers

      @Test public void testDigestCiphers() throws Exception
      Test 2: Verify that non-FIPS algorithms are blocked and FIPS algorithms are available. Reference: lobo-packages TestBouncyCastleFIPS.java#L47-L104

      Note: MD5 digest is always available per BC FIPS specification (Table 7 of BC-FJA-SecurityPolicy-1.0.2.pdf)

      Throws:
      Exception
    • testSSLCiphers

      @Test public void testSSLCiphers() throws Exception
      Test 3: Verify SSL cipher suites and BCJSSE provider. Reference: lobo-packages TestBouncyCastleFIPS.java#L106-L166
      Throws:
      Exception