Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error while using PGP Encryption on windows  RSS feed

kiran krishna
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is the script of code and I am using GPG encryption on windows.

PGPEncryptedDataGenerator encryptGenerator = new PGPEncryptedDataGenerator(PGPEncryptedDataGenerator.CAST5, new SecureRandom(), "BC");
outputStream =, compressedBytes.length);

I am getting the following error at the last line

org.bouncycastle.openpgp.PGPException: exception encrypting session key
at com.effigent.projectadjuncts.BCPGPCrypto.encryptedBytes(
at com.effigent.projectadjuncts.BCPGPCrypto.encryptedBytes(
at Application.<init>(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at java.lang.Class.newInstance0(
at java.lang.Class.newInstance(
at com.webobjects.appserver.WOApplication.main(
at Application.main(

If some one has any solution please provide

Thanks in Advance
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!