I have not packaged on an M1, I do not know if anyone has successfully.
But I think this line is the issue
module java.base does not export sun.security.x509
This may not work, but try using an older version of Java that has the required exports.
Secondly, are you using the M1 mac version of inteliJ or the x64 version through rosetta, whichever way around try the opposite.
On windows to support a 1024 bit key I had to use inteliJ 2019.2.4 and JSK 8.1.