if (armored) {
outputStream = new ArmoredOutputStream(outputStream);
}
PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new JcePGPDataEncryptorBuilder(SymmetricKeyAlgorithmTags.CAST5).
setWithIntegrityPacket(integrity).
setSecureRandom(new SecureRandom()).
setProvider("BC"));
encGen.addMethod(new JcePublicKeyKeyEncryptionMethodGenerator(key));
OutputStream encOut = encGen.open(outputStream, new byte[BUFFER_SIZE]);