Home / Class/ KeytoolSelfSignedCertGeneratorTest Class — netty Architecture

KeytoolSelfSignedCertGeneratorTest Class — netty Architecture

Architecture documentation for the KeytoolSelfSignedCertGeneratorTest class in KeytoolSelfSignedCertGeneratorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9f6a0e2a_18a1_7169_e92e_f7c8ea001faa["KeytoolSelfSignedCertGeneratorTest"]
  9cdea103_a18a_3e7a_4497_f9f96e912707["KeytoolSelfSignedCertGeneratorTest.java"]
  9f6a0e2a_18a1_7169_e92e_f7c8ea001faa -->|defined in| 9cdea103_a18a_3e7a_4497_f9f96e912707
  d08947d6_b3ec_a94a_9a27_b0243f32a2dc["checkAvailability()"]
  9f6a0e2a_18a1_7169_e92e_f7c8ea001faa -->|method| d08947d6_b3ec_a94a_9a27_b0243f32a2dc
  e02dabfa_5a98_e760_fccd_e963a743c975["test()"]
  9f6a0e2a_18a1_7169_e92e_f7c8ea001faa -->|method| e02dabfa_5a98_e760_fccd_e963a743c975

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/util/KeytoolSelfSignedCertGeneratorTest.java lines 30–52

class KeytoolSelfSignedCertGeneratorTest {
    @BeforeAll
    static void checkAvailability() {
        Assumptions.assumeTrue(KeytoolSelfSignedCertGenerator.isAvailable());
    }

    @Test
    public void test() throws Exception {
        SelfSignedCertificate.Builder builder = SelfSignedCertificate.builder()
                .fqdn("example.com")
                .algorithm("RSA")
                .bits(2048);
        Assertions.assertTrue(builder.generateKeytool());
        Assertions.assertEquals("RSA", builder.privateKey.getAlgorithm());

        X509Certificate cert;
        try (InputStream certStream = Files.newInputStream(Paths.get(builder.paths[0]))) {
            cert = (X509Certificate) CertificateFactory.getInstance("X509").generateCertificate(certStream);
        }
        cert.checkValidity();
        Assertions.assertEquals("CN=example.com", cert.getSubjectX500Principal().getName());
    }
}

Frequently Asked Questions

What is the KeytoolSelfSignedCertGeneratorTest class?
KeytoolSelfSignedCertGeneratorTest is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/util/KeytoolSelfSignedCertGeneratorTest.java.
Where is KeytoolSelfSignedCertGeneratorTest defined?
KeytoolSelfSignedCertGeneratorTest is defined in handler/src/test/java/io/netty/handler/ssl/util/KeytoolSelfSignedCertGeneratorTest.java at line 30.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free