aspose file tools
The moose likes Security and the fly likes BouncyCastle - Help with correcting deprecated method PGPEncryptedDataGenerator.addMethod(PGPPublicK Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » Security
Reply Bookmark "BouncyCastle - Help with correcting deprecated method PGPEncryptedDataGenerator.addMethod(PGPPublicK" Watch "BouncyCastle - Help with correcting deprecated method PGPEncryptedDataGenerator.addMethod(PGPPublicK" New topic
Author

BouncyCastle - Help with correcting deprecated method PGPEncryptedDataGenerator.addMethod(PGPPublicK

David A Morris
Greenhorn

Joined: May 09, 2012
Posts: 3
Hello,

I have a successful implementation using PGPEncryptedDataGenerator.addMethod(PGPPublicKey) as shown below but I notice this is deprecated and we should instead be using addMethod(PGPKeyEncryptionMethodGenerator).

I know I can continue to build my JAR ignoring the warning and simply move on, but I am guessing I "should" fix this now and not worry about getting bitten in the bum later.

Here is what I have that is working now.


It is the last line in the above code that is reported as deprecated.

I have attempted to correct it by doing the below (which appears to work OK) but I am not sure if I am approaching this the correct way.




Am I on the right track or am I barking up the wrong tree with this?
fancyjavawriter right
Greenhorn

Joined: Jul 05, 2012
Posts: 1
Hi David

I have an implementation just like yours, but I'm gettin an exception in my decryption method, getDataStream() is deprecated, in the documentation says that I have to use method that takes a PublicKeyDataDecryptorFactory do you have the right implementation of this funcionality? this is the code:




I would appreciate any help
David A Morris
Greenhorn

Joined: May 09, 2012
Posts: 3
I'm afraid I have not used the getDataStream() method in my implementation.

I have uploaded my solution onto my website here if you want to take a look.
http://dsmtech.com.au/tutorials/11-java/73-java-and-pgp-to-encrypt-a-file-with-multiple-keys.html
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: BouncyCastle - Help with correcting deprecated method PGPEncryptedDataGenerator.addMethod(PGPPublicK
 
Similar Threads
MultiDimenaional Array sort
Is cast5 128 supported by default sun JCE provider?
Encrypt a zip file using PGP in java
PGP encrypting using .asc public key file - encrypt String
Problem with processing data files of size larger than 350 MB