MCPcopy Create free account
hub / github.com/grpc/grpc-java / loadX509Cert

Method loadX509Cert

testing/src/main/java/io/grpc/testing/TestUtils.java:99–110  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Calls 2

closeMethod · 0.65
getInstanceMethod · 0.45

Tested by

no test coverage detected