cat.debug("<setUp()");
log.debug("<setUp()");
    protected void setUp() throws Exception {        cat.debug(">setUp()");        // Install BouncyCastle provider        Provider BCJce = new org.bouncycastle.jce.provider.BouncyCastleProvider();        int result = Security.addProvider(BCJce);        KeyStore keyStore=KeyStore.getInstance("PKCS12", "BC");        InputStream is = new ByteArrayInputStream(p12);        String keyStorePass = "foo123";        keyStore.load(is, keyStorePass.toCharArray());        String privateKeyAlias= "privateKey";        char[] pkPass = null;        privateKey = (PrivateKey)keyStore.getKey(privateKeyAlias, pkPass);        if (privateKey == null) {            cat.error("Cannot load key with alias '"+privateKeyAlias+"' from keystore.");            throw new Exception("Cannot load key with alias '"+privateKeyAlias+"' from keystore.");        }        Certificate[] certchain = KeyTools.getCertChain(keyStore, privateKeyAlias);        caCert = (X509Certificate)certchain[0];        cat.debug("<setUp()");    }