code: public static void PEMtoP12(File pem, String pemPassword, File toP12, String p12Password) throws IOException
  	{
  		if (!pem.exists())
  			throw new IllegalArgumentException("pem file does not exist: " + pem.getPath());
  
  		Execed openssl = Exec.utilityAs(null,
  		                                OPENSSL,
  		                                "pkcs12",
  		                                "-nodes",
  		                                "-in",
  		                                pem.getPath(),
  		                                "-out",
  		                                toP12.getPath(),
  		                                "-export",
  		                                "-passin",
  		                                "pass:" + pemPassword,
  		                                "-passout",
  		                                "pass:" + p12Password);
  		int returnCode = openssl.waitForExit();
  
  		if (returnCode != 0)
  			throw new IllegalStateException("Unexpected openssl exit code " + returnCode + "; output:\n" +
  			                                openssl.getStandardOut());
  	}
docs: @param pem
  the PEM file containing the keys & certificates to put in a P12
  @param pemPassword
  The password for any encrypted keys in the PEM
  @param toP12
  The PKCS12 file
  @param p12Password
  the password to put on the PKCS12 keystore
  
  @throws IOException
  if a catastrophic unexpected failure occurs during execution
  @throws IllegalArgumentException
  if the PEM keystore doesn't exist
  @throws IllegalStateException
  if openssl exits with a failure condition