posted 19 years ago
Following is the script of code and I am using GPG encryption on windows.
PGPEncryptedDataGenerator encryptGenerator = new PGPEncryptedDataGenerator(PGPEncryptedDataGenerator.CAST5, new SecureRandom(), "BC");
encryptGenerator.addMethod(recipientPublicKey);
outputStream = encryptGenerator.open(outputStream, compressedBytes.length);
I am getting the following error at the last line
org.bouncycastle.openpgp.PGPException: exception encrypting session key
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(PGPEncryptedDataGenerator.java:344)
at com.effigent.projectadjuncts.BCPGPCrypto.encryptedBytes(BCPGPCrypto.java:441)
at com.effigent.projectadjuncts.BCPGPCrypto.encryptedBytes(BCPGPCrypto.java:848)
at Application.<init>(Application.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:296)
at Application.main(Application.java:20)
If some one has any solution please provide
Thanks in Advance