DHPublicKey pubK = (DHPublicKey) kp.getPublic();
DHPrivateKey secK = (DHPrivateKey) kp.getPrivate();
pk = ((GnuDHPrivateKey) secK).getEncoded(IKeyPairCodec.PKCS8_FORMAT);
PrivateKey newSecK = new DHKeyPairPKCS8Codec().decodePrivateKey(pk);
harness.check(secK.equals(newSecK),
"DH private key ASN.1 encoder/decoder test");
pk = ((GnuDHPublicKey) pubK).getEncoded(IKeyPairCodec.X509_FORMAT);
PublicKey newPubK = new DHKeyPairX509Codec().decodePublicKey(pk);