svg.setPreferredCompressionAlgorithms(true, comprAlgs);
svg.setFeature(true, Features.FEATURE_MODIFICATION_DETECTION);
svg.setKeyFlags(true, KeyFlags.CERTIFY_OTHER + KeyFlags.SIGN_DATA);
PGPSignatureSubpacketVector hashedPcks = svg.generate();
PGPKeyRingGenerator keyRingGen = new PGPKeyRingGenerator(PGPSignature.POSITIVE_CERTIFICATION,
sgnKeyPair, identity, PGPEncryptedData.AES_256, passPhrase,
true, hashedPcks, unhashedPcks, new SecureRandom(), "BC");
svg = new PGPSignatureSubpacketGenerator();
svg.setKeyExpirationTime(true, 86400L * 366 * 2);
svg.setKeyFlags(true, KeyFlags.ENCRYPT_COMMS + KeyFlags.ENCRYPT_STORAGE);
svg.setPrimaryUserID(true, false);
svg.setFeature(true, Features.FEATURE_MODIFICATION_DETECTION);
hashedPcks = svg.generate();
keyRingGen.addSubKey(encKeyPair, hashedPcks, unhashedPcks);
byte[] encodedKeyRing = keyRingGen.generatePublicKeyRing().getEncoded();
PGPPublicKeyRing keyRing = new PGPPublicKeyRing(encodedKeyRing);
for (Iterator it = keyRing.getPublicKeys(); it.hasNext();)
{