Loads an X.509 certificate from the classpath resources in src/main/resources/certs. @param fileName name of a file in src/main/resources/certs. @deprecated Not for public use
(String fileName)
| 97 | * @deprecated Not for public use |
| 98 | */ |
| 99 | @Deprecated |
| 100 | public static X509Certificate loadX509Cert(String fileName) |
| 101 | throws CertificateException, IOException { |
| 102 | CertificateFactory cf = CertificateFactory.getInstance("X.509"); |
| 103 | |
| 104 | InputStream in = TestUtils.class.getResourceAsStream("/certs/" + fileName); |
| 105 | try { |
| 106 | return (X509Certificate) cf.generateCertificate(in); |
| 107 | } finally { |
| 108 | in.close(); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Creates an SSLSocketFactory which contains {@code certChainFile} as its only root certificate. |
no test coverage detected