Search code examples
encryptionpgp

Issue with basic PGP decryption - java


I have to implement a simple PGP decryption. Have decided to use 'BouncyCastle' as the provider.

i have the following things: - test java code (which decrypts) - the .asc file which needs to be decrypted - the pass phrase

The test code which I downloaded via Google, excepts a private key ring. I do not have it. My question is, who will provide this private key ring or private secret key file? Or should I be generating it with my public key?


Solution

  • The recipient of the encrypted data gives you (the sender of the encrypted data) the public key and keeps his secret key, well, secret. You encrypt the data using given public key.

    For test purposes you can generate a keypair and be your own recipient.