}
private static void decrypt() throws Exception {
FileDecryptor dec = new FileDecryptor(BouncyCastlePgpProvider.getInstance().getDecryptor());
File output = new File(root, "output");
Key decryptionKey = new FileBasedKey(new File(root, "receiver\\secring.gpg"));
Key verificationKey = new FileBasedKey(new File(root, "sender\\pubring.gpg"));
dec.setVerificationKey(verificationKey);
FileDecryptionResult res = dec.decrypt(signedAndEncryptedMessage, output, decryptionKey, "receiver".toCharArray());
System.out.println(res.authenticationStatus());
if (res.authenticationStatus() != MessageAuthenticationStatus.AUTHENTICATION_VERIFIED) {
System.err.println("Fake sender! Danger, Will Robinson!");