PublicKey publicKey = aes.loadPublicKey(ks, keyAlias);
byte[] ciphertext = aes.encrypt(publicKey, initialText);
byte[] plaintext = aes.decrypt(privateKey, ciphertext);
aes.printReadableMessages(initialText, ciphertext, plaintext);
} catch (NoSuchPaddingException | NoSuchAlgorithmException | IllegalBlockSizeException | BadPaddingException |
<BUG>KeyStoreException | CertificateException | UnrecoverableKeyException | InvalidKeyException | IOException ex) {
LOGGER.error(ex.getMessage(), ex);</BUG>
}
}
<BUG>private KeyStore loadKeystore(String keystorePath, char[] keystorePassword) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException {
InputStream keystoreStream = getClass().getResourceAsStream(keystorePath);</BUG>
KeyStore ks = KeyStore.getInstance("JCEKS");

PublicKey publicKey = aes.loadPublicKey(ks, keyAlias);
byte[] ciphertext = aes.encrypt(publicKey, initialText);
byte[] plaintext = aes.decrypt(privateKey, ciphertext);
aes.printReadableMessages(initialText, ciphertext, plaintext);
} catch (NoSuchPaddingException | NoSuchAlgorithmException | IllegalBlockSizeException | BadPaddingException |
KeyStoreException | CertificateException | UnrecoverableKeyException | InvalidKeyException |
IOException ex) {
LOGGER.error(ex.getMessage(), ex);
}
}
private KeyStore loadKeystore(String keystorePath, char[] keystorePassword) throws KeyStoreException,
CertificateException, NoSuchAlgorithmException, IOException {
InputStream keystoreStream = getClass().getResourceAsStream(keystorePath);
KeyStore ks = KeyStore.getInstance("JCEKS");
