FingerprintTrustManagerFactoryTest Class — netty Architecture
Architecture documentation for the FingerprintTrustManagerFactoryTest class in FingerprintTrustManagerFactoryTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 9becb15b_a654_ff83_4d42_ffdcccac581c["FingerprintTrustManagerFactoryTest"] 7bd65ec6_72fb_a8f7_017c_02e1136bc267["FingerprintTrustManagerFactoryTest.java"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|defined in| 7bd65ec6_72fb_a8f7_017c_02e1136bc267 f3223e52_01fd_1040_25be_8be456ee509a["testFingerprintWithInvalidLength()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| f3223e52_01fd_1040_25be_8be456ee509a bb440afd_12a9_90d7_b585_55b8956516ee["testFingerprintWithUnexpectedCharacters()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| bb440afd_12a9_90d7_b585_55b8956516ee c4ebad51_08b7_1786_97b0_66fee7a05b5b["testWithNoFingerprints()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| c4ebad51_08b7_1786_97b0_66fee7a05b5b a549ab5e_f21c_49a4_9301_c5cf6c8f5713["testWithNullFingerprint()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| a549ab5e_f21c_49a4_9301_c5cf6c8f5713 efc386ab_4127_bede_ca2e_89ded60e8643["testValidSHA1Fingerprint()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| efc386ab_4127_bede_ca2e_89ded60e8643 5eaa3cc5_5761_0dd0_3212_30e1d23259dd["testTrustedCertificateWithSHA256Fingerprint()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| 5eaa3cc5_5761_0dd0_3212_30e1d23259dd 2c23a0c7_f683_f1b8_d2e2_2350c1d217cb["testUntrustedCertificateWithSHA256Fingerprint()"] 9becb15b_a654_ff83_4d42_ffdcccac581c -->|method| 2c23a0c7_f683_f1b8_d2e2_2350c1d217cb
Relationship Graph
Source Code
handler/src/test/java/io/netty/handler/ssl/util/FingerprintTrustManagerFactoryTest.java lines 32–141
public class FingerprintTrustManagerFactoryTest {
private static final String FIRST_CERT_SHA1_FINGERPRINT
= "18:C7:C2:76:1F:DF:72:3B:2A:A7:BB:2C:B0:30:D4:C0:C0:72:AD:84";
private static final String FIRST_CERT_SHA256_FINGERPRINT
= "1C:53:0E:6B:FF:93:F0:DE:C2:E6:E7:9D:10:53:58:FF:" +
"DD:8E:68:CD:82:D9:C9:36:9B:43:EE:B3:DC:13:68:FB";
private static final X509Certificate[] FIRST_CHAIN;
private static final X509Certificate[] SECOND_CHAIN;
static {
try {
FIRST_CHAIN = loadCertCollection("test.crt");
SECOND_CHAIN = loadCertCollection("test2.crt");
} catch (Exception e) {
throw new Error(e);
}
}
@Test
public void testFingerprintWithInvalidLength() {
assertThrows(IllegalArgumentException.class, new Executable() {
@Override
public void execute() {
FingerprintTrustManagerFactory.builder("SHA-256").fingerprints("00:00:00").build();
}
});
}
@Test
public void testFingerprintWithUnexpectedCharacters() {
assertThrows(IllegalArgumentException.class, new Executable() {
@Override
public void execute() {
FingerprintTrustManagerFactory.builder("SHA-256").fingerprints("00:00:00\n").build();
}
});
}
@Test
public void testWithNoFingerprints() {
assertThrows(IllegalStateException.class, new Executable() {
@Override
public void execute() {
FingerprintTrustManagerFactory.builder("SHA-256").build();
}
});
}
@Test
public void testWithNullFingerprint() {
assertThrows(IllegalArgumentException.class, new Executable() {
@Override
public void execute() {
FingerprintTrustManagerFactory
.builder("SHA-256")
.fingerprints(FIRST_CERT_SHA256_FINGERPRINT, null)
.build();
}
});
}
@Test
public void testValidSHA1Fingerprint() throws Exception {
FingerprintTrustManagerFactory factory = new FingerprintTrustManagerFactory(FIRST_CERT_SHA1_FINGERPRINT);
assertTrue(factory.engineGetTrustManagers().length > 0);
assertTrue(factory.engineGetTrustManagers()[0] instanceof X509TrustManager);
X509TrustManager tm = (X509TrustManager) factory.engineGetTrustManagers()[0];
tm.checkClientTrusted(FIRST_CHAIN, "test");
}
@Test
public void testTrustedCertificateWithSHA256Fingerprint() throws Exception {
FingerprintTrustManagerFactory factory = FingerprintTrustManagerFactory
.builder("SHA-256")
.fingerprints(FIRST_CERT_SHA256_FINGERPRINT)
.build();
Source
Frequently Asked Questions
What is the FingerprintTrustManagerFactoryTest class?
FingerprintTrustManagerFactoryTest is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/util/FingerprintTrustManagerFactoryTest.java.
Where is FingerprintTrustManagerFactoryTest defined?
FingerprintTrustManagerFactoryTest is defined in handler/src/test/java/io/netty/handler/ssl/util/FingerprintTrustManagerFactoryTest.java at line 32.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free