diff --git a/src/main/java/com/github/dockerjava/core/util/CertificateUtils.java b/src/main/java/com/github/dockerjava/core/util/CertificateUtils.java index c760331d6..b5a5dcae6 100644 --- a/src/main/java/com/github/dockerjava/core/util/CertificateUtils.java +++ b/src/main/java/com/github/dockerjava/core/util/CertificateUtils.java @@ -72,7 +72,7 @@ public static KeyStore createKeyStore(final String keypem, final String certpem) /** * from "cert.pem" String */ - private static List loadCertificates(final String certpem) throws IOException, + public static List loadCertificates(final String certpem) throws IOException, CertificateException { final StringReader certReader = new StringReader(certpem); try (BufferedReader reader = new BufferedReader(certReader)) { @@ -83,7 +83,7 @@ private static List loadCertificates(final String certpem) throws I /** * "cert.pem" from reader */ - private static List loadCertificates(final Reader reader) throws IOException, + public static List loadCertificates(final Reader reader) throws IOException, CertificateException { try (PEMParser pemParser = new PEMParser(reader)) { List certificates = new ArrayList<>(); @@ -105,7 +105,7 @@ private static List loadCertificates(final Reader reader) throws IO * Return private key ("key.pem") from Reader */ @CheckForNull - private static PrivateKey loadPrivateKey(final Reader reader) throws IOException, NoSuchAlgorithmException, + public static PrivateKey loadPrivateKey(final Reader reader) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException { try (PEMParser pemParser = new PEMParser(reader)) { Object readObject = pemParser.readObject(); @@ -138,7 +138,7 @@ private static PrivateKey loadPrivateKey(final Reader reader) throws IOException } @CheckForNull - private static PrivateKey guessKey(byte[] encodedKey) throws NoSuchAlgorithmException { + public static PrivateKey guessKey(byte[] encodedKey) throws NoSuchAlgorithmException { //no way to know, so iterate for (String guessFactory : new String[]{"RSA", "ECDSA"}) { try { @@ -157,7 +157,7 @@ private static PrivateKey guessKey(byte[] encodedKey) throws NoSuchAlgorithmExce * Return KeyPair from "key.pem" */ @CheckForNull - private static PrivateKey loadPrivateKey(final String keypem) throws IOException, NoSuchAlgorithmException, + public static PrivateKey loadPrivateKey(final String keypem) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException { try (StringReader certReader = new StringReader(keypem); BufferedReader reader = new BufferedReader(certReader)) {