testSet.add(new Test(alias, new KeyPair(ks.getCertificate(alias).getPublicKey(), privateKey), providerName));
testSet.add(new Test(alias, new KeyPair(keyStore.getCertificate(alias).getPublicKey(), privateKey), providerName));
    private static Test[] getTests(final String providerName,                                   final String keyStoreType,                                   final String storeID) throws Exception {        final KeyStore ks; {            KeyStore tmp = null;            while( tmp==null ) {                final InputStream is = new ByteArrayInputStream(storeID.getBytes());                tmp = KeyStore.getInstance(keyStoreType, providerName);                try {                    tmp.load(is, null);                } catch( Throwable t ) {                    tmp = null;                    t.printStackTrace(System.err);                    System.err.println("Card set not preloaded. Hit return when error fixed");                    new BufferedReader(new InputStreamReader(System.in)).readLine();                }            }            ks = tmp;        }        Enumeration e = ks.aliases();        Set testSet = new HashSet();        while( e.hasMoreElements() ) {            String alias = (String)e.nextElement();            if ( ks.isKeyEntry(alias) ) {                PrivateKey privateKey;                try {                    privateKey = (PrivateKey)ks.getKey(alias, null);                } catch (UnrecoverableKeyException e1) {                    System.err.println("Give password for key "+alias+':');                    privateKey = (PrivateKey)ks.getKey(alias,                                                        new BufferedReader(new InputStreamReader(System.in)).readLine().toCharArray() );                }                testSet.add(new Test(alias, new KeyPair(ks.getCertificate(alias).getPublicKey(), privateKey), providerName));            }        }        return (Test[])testSet.toArray(new Test[0]);    }