@Test(expected = IOException.class)
public void testLoadUnencryptedPrivateKeyFromKeyStoreWithWrongPassword() throws GeneralSecurityException, IOException {

    if (x509TestContext.isKeyStoreEncrypted()) {
        throw new IOException();
    }
    PemReader.loadPrivateKey(
            x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM),
            Optional.of("wrong password"));
}