>>but when my client encrypts the file on his side I am not able to decrypt it using bouncycastle API
You are, i assume, attempting to decrypt it using his *public* key are you? That's what you must do
Main Topics
Browse All TopicsHello, I am trying to decrypt PGP encrypted file. The file was encrypted using my public key that I generated. I could encrypt and decrypt the files that I created locally using bouncycastle API, but when my client encrypts the file on his side I am not able to decrypt it using bouncycastle API but could decrypt it manually using gnupg on command prompt.
When run decryption in my class I am not able to find secret key to decrypt the file. And I am not sure how my client decrypts it.
Please let me know if you have any suggestions.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
CEHJ, no the message is being encrypted using public key that I sent to them. And I am able to decrypt the message on command prompt using GnuPG. I checked the path to the secret key and the file I am trying to decrypt all looks good just can't find the key to decrypt encrypted file using my implementation of bouncy castle api
I haven't used the API myself, but there's an example of decryption here:
https://www.epointsystem.o
The example does almost the same thing in comparing the keys, but the problem is that when I compare the public vs. private keys I am getting following results:
Data was encrypted using public key: -4270675083819455261
Data was encrypted using public key: 5471684833902076854
Got secret key: -7878772790183064541 mask=true SigningKey = true
Got secret key: 5471684833902076854 mask=false SigningKey= false
But it still puzzles me how I was able to decrypt same file in command prompt I got couple messages but was able to decrypt it.
gpg: Signature made 04/21/09 03:41:20 using DSA key ID 2BD4FDE5
gpg: Can't check signature: public key not found
gpg: WARNING: message was not integrity protected
Business Accounts
Answer for Membership
by: gibu_georgePosted on 2009-04-22 at 09:01:00ID: 24206406
What is the error/exception thrown when you try to decrypt?