pubEnc = pubKey.getEncoded();
keyFac = KeyFactory.getInstance(pubKey.getAlgorithm(), "BC");
pubX509 = new X509EncodedKeySpec(pubEnc);
pubKey = (PublicKey)keyFac.generatePublic(pubX509);
//
// double private key encoding test
//
byte[] privEnc = privKey.getEncoded();