public static byte[] decryptKeyWithIES(byte[] input, long entryId,
PublicKey publicKey, PrivateKey privateKey)
throws GeneralSecurityException {
try {
// BC appears to be happier with BCECPrivateKeys:
privateKey = new BCECPrivateKey((ECPrivateKey) privateKey, null);
return _cryptIES(input, privateKey, false);
} catch (GeneralSecurityException e) {
log.error("Error while decrypting key", e);
throw new GeneralSecurityException(e);