This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line! See this thread for details.
I am trying to load the keystore with the private key and password, but i am facing an exception.
Here the exception is :
java.io.IOException: Wrong version of key store.
at org.bouncycastle.jce.provider.JDKKeyStore.engineLoad(Unknown Source)
A PGP keyring cannot be used as a KeyStore. It is not compatible with, or related in any way to, a Bouncycastle keystore, nor any of Sun's keystores. You must use the methods of the bouncycastle PGP api to process PGP keys and messages.
if by keystore you mean the KeyStore class, then no, you cannot use the KeyStore class to access your PGP keys. Java 6 contains no support for PGP. You must use a third party library such as Bouncycastle's. There are two classes, PGPSecretKeyRing and PGPPublicKeyRing that are designed for processing a keyring of a single master key, and other relevant classes as well.