Skip to content

Commit

Permalink
review: EC private key support
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Jan 3, 2024
1 parent 3956a44 commit 4aa4fd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ public PrivateKey call() throws IOException {
throw new KubernetesClientException(
"JcaPEMKeyConverter is provided by BouncyCastle, an optional dependency. To use support for EC Keys you must explicitly add this dependency to classpath.");
} catch (IOException e) {
e.printStackTrace();
throw new KubernetesClientException(e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import static org.junit.Assert.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class CertUtilsTest {
Expand Down Expand Up @@ -211,14 +210,13 @@ void loadECPrivateOnlyKey()
}

@Test
void loadNothingError()
throws InvalidKeySpecException, CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException {
void loadNothingError() {
String privateKeyPath = Utils.filePath(getClass().getResource("/ssl-test/empty"));
String certPath = Utils.filePath(getClass().getResource("/ssl-test/empty"));

Exception exception = assertThrows(KubernetesClientException.class,
() -> CertUtils.createKeyStore(null, certPath, null, privateKeyPath, "EC", "foo", null, null));
assertTrue(exception.getMessage().equals("Got null PEM object from EC key's input stream."));
assertThatExceptionOfType(KubernetesClientException.class)
.isThrownBy(() -> CertUtils.createKeyStore(null, certPath, null, privateKeyPath, "EC", "foo", null, null))
.withMessage("Got null PEM object from EC key's input stream.");
}

@Test
Expand Down

0 comments on commit 4aa4fd1

Please sign in to comment.