DSAPublicKey pubK = (DSAPublicKey) kp.getPublic();
DSAPrivateKey secK = (DSAPrivateKey) kp.getPrivate();
pk = ((DSSPrivateKey) secK).getEncoded(IKeyPairCodec.PKCS8_FORMAT);
PrivateKey newSecK = new DSSKeyPairPKCS8Codec().decodePrivateKey(pk);
harness.check(secK.equals(newSecK),
"DSS private key ASN.1 encoder/decoder test");
pk = ((DSSPublicKey) pubK).getEncoded(IKeyPairCodec.X509_FORMAT);
PublicKey newPubK = new DSSKeyPairX509Codec().decodePublicKey(pk);