@Test
public void testGenerateKeyPair() throws Exception
{

    KeyPair keyPair = PGPEncryptionUtil.generateKeyPair( USER_ID, SECRET_PWD, false );
    assertNotNull( PGPEncryptionUtil
            .findPublicKeyById( new ByteArrayInputStream( keyPair.getPubKeyring() ), keyPair.getSubKeyId() ) );
    assertNotNull( PGPEncryptionUtil
            .findSecretKeyByFingerprint( new ByteArrayInputStream( keyPair.getSecKeyring() ),
                    keyPair.getPrimaryKeyFingerprint() ) );
}