PGPKeyPair elgKeyPair = new PGPKeyPair(PGPPublicKey.ELGAMAL_ENCRYPT, elgKp, new Date(), "BC");
PGPKeyRingGenerator keyRingGen = new PGPKeyRingGenerator(PGPSignature.POSITIVE_CERTIFICATION, dsaKeyPair,
"test", PGPEncryptedData.AES_256, passPhrase, true, null, null, new SecureRandom(), "BC");
keyRingGen.addSubKey(elgKeyPair);
PGPSecretKeyRing keyRing = keyRingGen.generateSecretKeyRing();
keyRing.getSecretKey().extractPrivateKey(passPhrase, "BC");