private static final String ALIAS = "verisignclass1ca";
public void test(final TestHarness harness)
{
harness.checkPoint("TestOfPublicKeyring");
final GnuPublicKeyring kr = new GnuPublicKeyring();
try
{
final Map attributes = new HashMap();
attributes.put(IKeyring.KEYRING_DATA_IN,
new ByteArrayInputStream(keyring));
attributes.put(IKeyring.KEYRING_PASSWORD, "password".toCharArray());
Security.addProvider(new Gnu());
kr.load(attributes);
harness.check(true, "load(...)");
harness.check(kr.containsCertificate(ALIAS), "containsCertificate(...)");
final List list = kr.get(ALIAS);
harness.check(list.size() == 1, "get(...).size() == 1");
final Certificate cert = kr.getCertificate(ALIAS);
harness.check(cert != null, "getCertificate(...) != null");
// System.out.println("cert="+cert);
}
catch (Exception x)