// retrieve the certificate
Certificate[] chain2 = ks1.getCertificateChain(ALIAS);
harness.check(Arrays.equals(chain2, chain1),
"In-memory and original certificate MUST be equal");
// store a (public) key entry
PublicKey k1 = new DSSPublicKey(Registry.ASN1_ENCODING_ID, p, q, g, y);
ks1.setKeyEntry(ALIAS_DSA, k1, null, null);
// retrieve the same (public) key-entry
PublicKey k2 = (PublicKey) ks1.getKey(ALIAS_DSA, null);
// check it's still the same
harness.check(k2, k1, "In-memory and original public key MUST be equal");