PrivateKey privkey = kp.getPrivate();
PrincipalBuilder princbuilder =
PrincipalBuilder.getInstance("OpenPGP/UserID");
Principal userid =
princbuilder.build(name + " <"+jid+">");
CertificateBuilder certbuilder =
CertificateBuilder.getInstance("OpenPGP/Self");
Certificate cert = certbuilder.build(pubkey, userid, privkey, sr);
complexPublicKey.addCertificate(cert);
complexPrivateKey.addCertificate(cert);
complexPrivateKey.addPrivateKey(privkey, pubkey,
passPhrase, sr);