Package org.jitterbit.crypto.pgp

Examples of org.jitterbit.crypto.pgp.FileDecryptor.decrypt()


        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!");
        }
    }
View Full Code Here


   
    public void runDecryption() throws Exception {
        File output = new File(root, "decrypted_with_jitterbit.txt");
        File keyFile = new File(root, "receiver/secring.gpg");
        FileDecryptor dec = getFileDecryptor();
        dec.decrypt(encrypted, output, new FileBasedKey(keyFile), "receiver".toCharArray());
    }
   
    private FileDecryptor getFileDecryptor() {
        PgpProvider provider = BouncyCastlePgpProvider.getInstance();
        return new FileDecryptor(provider.getDecryptor());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.