public void testKeyPairRawCodec(TestHarness harness)
{
harness.checkPoint("testKeyPairRawCodec");
byte[] pk;
IKeyPairCodec codec = new RSAKeyPairRawCodec();
kp = kpg.generate();
RSAPublicKey pubK = (RSAPublicKey) kp.getPublic();
pk = ((GnuRSAPublicKey) pubK).getEncoded(IKeyPairCodec.RAW_FORMAT);
PublicKey newPubK = codec.decodePublicKey(pk);
harness.check(pubK.equals(newPubK),
"RSA public key Raw encoder/decoder test");
RSAPrivateKey secK = (RSAPrivateKey) kp.getPrivate();
pk = ((GnuRSAPrivateKey) secK).getEncoded(IKeyPairCodec.RAW_FORMAT);
PrivateKey newSecK = codec.decodePrivateKey(pk);
harness.check(secK.equals(newSecK),
"RSA private key Raw encoder/decoder test");
}