byte[] pk;
RSAPublicKey pubK = (RSAPublicKey) kp.getPublic();
pk = ((GnuRSAPublicKey) pubK).getEncoded(IKeyPairCodec.X509_FORMAT);
PublicKey newPubK = new RSAKeyPairX509Codec().decodePublicKey(pk);
harness.check(pubK.equals(newPubK),
"RSA public key ASN.1 encoder/decoder test");
RSAPrivateKey secK = (RSAPrivateKey) kp.getPrivate();
pk = ((GnuRSAPrivateKey) secK).getEncoded(IKeyPairCodec.PKCS8_FORMAT);