}
private void testUmlaut()
throws Exception
{
PGPPublicKeyRing pubRing = new PGPPublicKeyRing(umlautKeySig);
PGPPublicKey pub = pubRing.getPublicKey();
String userID = (String)pub.getUserIDs().next();
for (Iterator it = pub.getSignatures(); it.hasNext();)
{
PGPSignature sig = (PGPSignature)it.next();
if (sig.getSignatureType() == PGPSignature.POSITIVE_CERTIFICATION)
{
sig.initVerify(pub, "BC");
if (!sig.verifyCertification(userID, pub))
{
fail("failed UTF8 userID test");
}
}
}
//
// this is quicker because we are using pregenerated parameters.
//
KeyPairGenerator rsaKpg = KeyPairGenerator.getInstance("RSA", "BC");
KeyPair rsaKp = rsaKpg.generateKeyPair();
PGPKeyPair rsaKeyPair1 = new PGPKeyPair(PGPPublicKey.RSA_GENERAL, rsaKp, new Date());
rsaKp = rsaKpg.generateKeyPair();
PGPKeyPair rsaKeyPair2 = new PGPKeyPair(PGPPublicKey.RSA_GENERAL, rsaKp, new Date());
char[] passPhrase = "passwd".toCharArray();
PGPKeyRingGenerator keyRingGen = new PGPKeyRingGenerator(PGPSignature.POSITIVE_CERTIFICATION, rsaKeyPair1,
userID, PGPEncryptedData.AES_256, passPhrase, null, null, new SecureRandom(), "BC");
PGPPublicKeyRing pubRing1 = keyRingGen.generatePublicKeyRing();
pub = pubRing1.getPublicKey();
for (Iterator it = pub.getSignatures(); it.hasNext();)
{
PGPSignature sig = (PGPSignature)it.next();