ESP32 IDF encrypting uploads

Is there an option to upload to an encrypted core partition?

This is the equivalent process in ESP IDF’s tooling that I’m trying to replicate in PlatformIO:

  1. I set up my ESP32 partition table so the code partition is encrypted. Easy in PlatformIO.
  2. I turn on device encryption with “ menuconfig” - in PlatformIO this is done by simply editing the sdkconfig file and setting “CONFIG_SECURE_FLASH_ENC_ENABLED=y”. All good.
  3. Build the code with “ build”. Easy in PlatformIO.
  4. Upload the code. In IDF you do this with “ flash” the first time you are encrypting the device (in PlatforIO use “pio run -t upload”), and thereafter you use “ encrypted-app-flash”. Is there an equivalent to the 2nd of those commands in PlatformIO? You can’t use the normal upload as it will not encrypt and thus the device will have garbage and not run, just reboot over and over.