code: public static void filterP12(File p12, String p12Password) throws IOException
  	{
  		if (!p12.exists())
  			throw new IllegalArgumentException("p12 file does not exist: " + p12.getPath());
  
  		final File pem;
  		if (USE_GENERIC_TEMP_DIRECTORY)
  			pem = File.createTempFile(UUID.randomUUID().toString(), "");
  		else
  			pem = new File(p12.getAbsolutePath() + ".pem.tmp");
  
  		final String pemPassword = UUID.randomUUID().toString();
  
  		try
  		{
  			P12toPEM(p12, p12Password, pem, pemPassword);
  			PEMtoP12(pem, pemPassword, p12, p12Password);
  		}
  		finally
  		{
  			if (pem.exists())
  				if (!pem.delete())
  					log.warn("[OpenSSLPKCS12] {filterP12} Could not delete temporary PEM file " + pem);
  
  		}
  	}
docs: Recreates a PKCS12 KeyStore using OpenSSL; this is a workaround a BouncyCastle-Firefox compatibility bug
  
  @param p12
  The PKCS12 Keystore to filter
  @param p12Password
  The password for the keystore
  
  @throws IOException
  if a catastrophic unexpected failure occurs during execution
  @throws IllegalArgumentException
  if the PKCS12 keystore doesn't exist
  @throws IllegalStateException
  if openssl exits with a failure condition