Recommended solutions based on your search
If you are using maven you'd like to exclude your binaries from filtering process.
Java Keytool doesn't accept PEM files, you need to convert it to Der before: "openssl x509 -outform der -in certificate.pem -out certificate.der" and to import it to the keystore "keytool -import -alias your-alias -keystore cacerts -file certificate.der"
Solutions on the web
java.io.IOException: PKCS12 key store mac invalid - wrong password or corrupted file. at org.bouncycastle.jcajce.provider.keystore.pkcs12.P KCS12KeyStoreSpi.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)