PDDocument encryptedDoc = reload(document);
try
{
Assert.assertTrue(encryptedDoc.isEncrypted());
PublicKeySecurityHandler securityHandler
= (PublicKeySecurityHandler) encryptedDoc.getEncryption().getSecurityHandler();
securityHandler.setVerbose(true);
encryptedDoc.openProtection(decryption2);
fail("No exception when using an incorrect decryption key");
}
catch (IOException ex)
{